<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Peter’s Substack]]></title><description><![CDATA[My personal Substack]]></description><link>https://www.peternaf.com</link><image><url>https://substackcdn.com/image/fetch/$s_!rIWZ!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fcc7748-5616-4c6c-9177-20671172e987_1280x1280.png</url><title>Peter’s Substack</title><link>https://www.peternaf.com</link></image><generator>Substack</generator><lastBuildDate>Thu, 16 Apr 2026 10:22:27 GMT</lastBuildDate><atom:link href="https://www.peternaf.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Peter Naftaliev]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[peternaf@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[peternaf@substack.com]]></itunes:email><itunes:name><![CDATA[Peter Naftaliev]]></itunes:name></itunes:owner><itunes:author><![CDATA[Peter Naftaliev]]></itunes:author><googleplay:owner><![CDATA[peternaf@substack.com]]></googleplay:owner><googleplay:email><![CDATA[peternaf@substack.com]]></googleplay:email><googleplay:author><![CDATA[Peter Naftaliev]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[FFmpeg 8.0 (Part 2): How to use pad_cuda]]></title><description><![CDATA[Original blog post published in Rendi]]></description><link>https://www.peternaf.com/p/ffmpeg-8-0-part-2-how-to-use-pad-cuda</link><guid isPermaLink="false">https://www.peternaf.com/p/ffmpeg-8-0-part-2-how-to-use-pad-cuda</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Wed, 18 Mar 2026 11:03:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!4GPZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85a37c5b-0c16-4155-b8fd-e8e99ae01188_1066x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em><a href="https://www.rendi.dev/post/ffmpeg-8-0-part-2-how-to-use-pad_cuda?utm_source=peternaf.com">Original blog post published in Rendi</a></em></p><p>FFmpeg 8.0 introduces a major performance boost with <a href="https://ffmpeg.org/ffmpeg-filters.html#pad_005fcuda-1">pad_cuda</a>, an Nvidia GPU-accelerated padding filter that works with <a href="https://ffmpeg.org/ffmpeg-filters.html#scale_005fcuda-1">scale_cuda</a>. </p><p>Padding and scaling are used for adjusting resolution and aspect ratio, such as converting a horizontal clip to a vertical one, which is particularly useful for platforms like TikTok, YouTube Shorts, and Instagram Reels. </p><p>Because these operations modify every pixel, they require full re-encoding, which makes them computationally expensive in FFmpeg. In this post, I will demonstrate how to use the new pad_cuda and the computational gain it introduces.</p><p>This post is part of a series of posts about the new <a href="https://ffmpeg.org/index.html#pr8.0">FFmpeg 8.0</a> release:</p><ol><li><p><a href="https://peternaf.com/p/ffmpeg-8-0-part-1-using-whisper-for-native-video-transcription-in-ffmpeg">FFmpeg 8.0 (Part 1): Using Whisper for Native Video Transcription in FFmpeg</a></p></li><li><p><a href="https://peternaf.com/p/ffmpeg-8-0-part-3-failed-attempts-to-use-vulkan-for-av1-encoding-vp9-decoding">FFmpeg 8.0 (Part 3): Failed attempts to use Vulkan for AV1 Encoding &amp; VP9 Decoding</a></p></li></ol><p>To install FFmpeg 8.0, follow the instructions for <a href="https://peternaf.com/p/ffmpeg-8-0-part-1-using-whisper-for-native-video-transcription-in-ffmpeg">&#8220;How to install FFmpeg 8&#8221;</a>. The setup used is a Windows 11 Lenovo laptop with Nvidia RTX 4060 - Driver version 581.29, CUDA version 13.0</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4GPZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85a37c5b-0c16-4155-b8fd-e8e99ae01188_1066x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4GPZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85a37c5b-0c16-4155-b8fd-e8e99ae01188_1066x800.png 424w, https://substackcdn.com/image/fetch/$s_!4GPZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85a37c5b-0c16-4155-b8fd-e8e99ae01188_1066x800.png 848w, https://substackcdn.com/image/fetch/$s_!4GPZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85a37c5b-0c16-4155-b8fd-e8e99ae01188_1066x800.png 1272w, https://substackcdn.com/image/fetch/$s_!4GPZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85a37c5b-0c16-4155-b8fd-e8e99ae01188_1066x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4GPZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85a37c5b-0c16-4155-b8fd-e8e99ae01188_1066x800.png" width="1066" height="800" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/85a37c5b-0c16-4155-b8fd-e8e99ae01188_1066x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:800,&quot;width&quot;:1066,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:650220,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.peternaf.com/i/191016644?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85a37c5b-0c16-4155-b8fd-e8e99ae01188_1066x800.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4GPZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85a37c5b-0c16-4155-b8fd-e8e99ae01188_1066x800.png 424w, https://substackcdn.com/image/fetch/$s_!4GPZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85a37c5b-0c16-4155-b8fd-e8e99ae01188_1066x800.png 848w, https://substackcdn.com/image/fetch/$s_!4GPZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85a37c5b-0c16-4155-b8fd-e8e99ae01188_1066x800.png 1272w, https://substackcdn.com/image/fetch/$s_!4GPZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F85a37c5b-0c16-4155-b8fd-e8e99ae01188_1066x800.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The following are two examples of how to convert a 1440x1080 <a href="https://storage.rendi.dev/sample/popeye_talking.mp4">Popeye talking</a> video into a vertical video with padding, first using the old method (CPU encoding) and second using the new pad_cuda (GPU encoding) filter. </p><p>We can see the significant processing time improvement - running with the GPU is 3.5x faster than the CPU.</p><h4>CPU:</h4><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;317c24d1-bbd6-4ac0-b278-d2cc88c4d245&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">$INPUT_FILE=&#8221;popeye_talking.mp4&#8221;
$OUTPUT_FILE=&#8221;output_resized_pad_cpu.mp4&#8221;

$SCALE_WIDTH=&#8221;1080&#8221;
$SCALE_HEIGHT=&#8221;1920&#8221;
$FORCE_ASPECT=&#8221;decrease&#8221;
$PAD_WIDTH=&#8221;1080&#8221;
$PAD_HEIGHT=&#8221;1920&#8221;
$PAD_X=&#8221;(ow-iw)/2&#8221;
$PAD_Y=&#8221;(oh-ih)/2&#8221;
$PAD_COLOR=&#8221;black&#8221;

$SAR=&#8221;1:1&#8221;

$VIDEO_ENCODER=&#8221;libx264&#8221;

./ffmpeg -i $INPUT_FILE -vf &#8220;scale=w=&#8217;$SCALE_WIDTH&#8217;:h=&#8217;$SCALE_HEIGHT&#8217;:force_original_aspect_ratio=&#8217;$FORCE_ASPECT&#8217;,pad=&#8217;$PAD_WIDTH&#8217;:&#8217;$PAD_HEIGHT&#8217;:&#8217;$PAD_X&#8217;:&#8217;$PAD_Y&#8217;:color=&#8217;$PAD_COLOR&#8217;,setsar=&#8217;$SAR&#8217;&#8221; -c:v $VIDEO_ENCODER $OUTPUT_FILE

....
time=00:00:20.91 bitrate=3285.0kbits/s speed=4.95x elapsed=0:00:04.22</code></pre></div><h4>GPU-CUDA:</h4><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;e2a15d2a-04c5-4f1e-bb21-ab388d3c41df&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">$OUTPUT_FILE=&#8221;output_resized_pad_cuda.mp4&#8221;

$VIDEO_ENCODER=&#8221;h264_nvenc&#8221; #Changing to the Nvidia x264 encoder for GPU support

./ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i $INPUT_FILE -vf &#8220;scale_cuda=w=&#8217;$SCALE_WIDTH&#8217;:h=&#8217;$SCALE_HEIGHT&#8217;:force_original_aspect_ratio=&#8217;$FORCE_ASPECT&#8217;,pad_cuda=&#8217;$PAD_WIDTH&#8217;:&#8217;$PAD_HEIGHT&#8217;:&#8217;$PAD_X&#8217;:&#8217;$PAD_Y&#8217;:color=&#8217;$PAD_COLOR&#8217;,setsar=&#8217;$SAR&#8217;&#8221; -c:v $VIDEO_ENCODER $OUTPUT_FILE

....
time=00:00:20.87 bitrate=2394.6kbits/s speed=16.1x elapsed=0:00:01.29</code></pre></div><blockquote><p><strong>Note</strong> that it is not possible to run pad_cuda with scale (not CUDA), since both filters are running on the same hardware and need to be specified accordingly for the same hardware.</p></blockquote><h3>How the scale_cuda (and scale) filter works</h3><p>The scale filter resizes the video to match a new width and height. In this example:</p><pre><code>scale_cuda=w=1080:h=1920:force_original_aspect_ratio=decrease</code></pre><p>This resizes the video to fit <strong>within</strong> 1080&#215;1920 without stretching. FFmpeg will automatically reduce one dimension to preserve the original aspect ratio. For example, a 1920&#215;1080 video will be resized to <strong>1080&#215;810</strong> before padding.</p><h4>Helpful scale options</h4><p>Expression</p><p>Purpose</p><p>scale=w=1080:h=-1</p><p>Automatically calculates the height that preserves the aspect ratio, fitting inside a width of 1080</p><p>scale=w=1080:h=-2</p><p>Like above, but forces dimensions divisible by 2 (required by many encoders)</p><p>force_original_aspect_ratio=decrease</p><p>Ensures neither dimension exceeds the requested size while preserving the ratio</p><p>force_original_aspect_ratio=increase</p><p>Expands the image to fill the requested size, then crops or pads as needed</p><blockquote><p><strong>Note:</strong> You cannot use scale=w=-1:h=1920 here &#8212; FFmpeg would choose a width larger than 1080, which breaks the target output resolution.</p></blockquote><h3>How the pad_cuda (and pad) filter works in FFmpeg 8</h3><p>After scaling, the video may not fill the target resolution completely. The pad filter centers the video and adds borders around it so the final output matches the desired dimensions.</p><pre><code>pad=1080:1920:(ow-iw)/2:(oh-ih)/2:color=black</code></pre><p>Values are <strong>width:height:x:y,</strong> where x:y is the top left corner.</p><p>This means:</p><p>Parameter</p><p>Meaning</p><p>1080:1920</p><p>Final output resolution</p><p>(ow-iw)/2:(oh-ih)/2</p><p>ow is output width, iw is input width, and correspondingly to height. The original video&#8217;s top left corner will be placed such that the video is in the middle, and the padding is around it</p><p>color=black</p><p>Border background color</p><p>You can also use negative offsets for auto-centering for a similar effect:</p><pre><code>pad=1080:1920:-1:-1:color=black</code></pre><h3><strong>setsar</strong></h3><pre><code>setsar=1:1</code></pre><p>SAR = Sample Aspect Ratio. Setting it to 1:1 ensures pixel proportions remain correct and prevents stretched output. (1, 1.0, and 1/1 are equivalent.)</p><h3>Encoding\Decoding parameters</h3><h5>libx264</h5><p>A software H.264 encoder, a CPU-based encoder commonly used in FFmpeg commands.</p><h5>h264_nvenc</h5><p>NVIDIA&#8217;s hardware-accelerated H.264 encoder. It uses the GPU&#8217;s dedicated video encoding unit instead of the CPU&#8217;s general-purpose cores.</p><h5>-hwaccel cuda </h5><p>Enables GPU hardware acceleration using CUDA.</p><h5>-hwaccel_output_format cuda</h5><p>Keeps the decoded frames in GPU memory to avoid expensive CPU&#8596;GPU memory copies.</p><p>Read more about scaling, padding, and encoding in our <a href="https://github.com/rendi-api/ffmpeg-cheatsheet/tree/main">FFmpeg cheat sheet</a></p>]]></content:encoded></item><item><title><![CDATA[FFmpeg 8.0 (Part 3): Failed attempts to use Vulkan for AV1 Encoding & VP9 Decoding]]></title><description><![CDATA[Original blog post published in Rendi]]></description><link>https://www.peternaf.com/p/ffmpeg-8-0-part-3-failed-attempts-to-use-vulkan-for-av1-encoding-vp9-decoding</link><guid isPermaLink="false">https://www.peternaf.com/p/ffmpeg-8-0-part-3-failed-attempts-to-use-vulkan-for-av1-encoding-vp9-decoding</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Wed, 18 Mar 2026 11:03:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!m-eV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e3adb68-deb6-468b-81dc-75427e4c0fac_2123x1195.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em><a href="https://www.rendi.dev/post/ffmpeg-8-0-part-3-failed-attempts-to-use-vulkan-for-av1-encoding-vp9-decoding?utm_source=peternaf.com">Original blog post published in Rendi</a></em></p><p>FFmpeg 8.0 adds Vulkan support for AV1 encoding and VP9 decoding. Below is an explanation of all these terms, along with my personal experience using these new features in FFmpeg.</p><p>This post is part of a series of posts about the new <a href="https://ffmpeg.org/index.html#pr8.0">FFmpeg 8.0</a> release:</p><ol><li><p><a href="https://peternaf.com/p/ffmpeg-8-0-part-1-using-whisper-for-native-video-transcription-in-ffmpeg">FFmpeg 8.0 (Part 1): Using Whisper for Native Video Transcription in FFmpeg</a></p></li><li><p><a href="https://peternaf.com/p/ffmpeg-8-0-part-2-how-to-use-pad-cuda">FFmpeg 8.0 (Part 2): How to use pad_cuda</a></p></li></ol><h2>Vulkan</h2><p>Vulkan is a cross-platform, open standard set of APIs that allow programs to use GPU hardware. FFmpeg is built with Vulkan 1.3. </p><p>FFmpeg <a href="https://ffmpeg.org/index.html#pr7.1">7.1</a> and <a href="https://ffmpeg.org/index.html#pr6.1">6.1</a> already supported Vulkan for H264 and HVEC encoding and decoding, as well as AV1 decoding.</p><h4>Codecs</h4><ul><li><p><a href="https://en.wikipedia.org/wiki/Advanced_Video_Coding">H264</a> and <a href="https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding">HVEC</a> (also known as H265) are two common codecs used in the common MP4 container.</p></li><li><p><a href="https://en.wikipedia.org/wiki/AV1">AV1</a> is an open-source codec that is gaining popularity.</p></li><li><p><a href="https://en.wikipedia.org/wiki/VP9">VP9</a> is an open source codec owned by Google and used in many Google products (including YouTube)</p></li></ul><p>The new FFmpeg 8.0 Vulkan version supports:</p><ul><li><p>Hardware-accelerated Vulkan AV1 encoding</p></li><li><p>Hardware-accelerated Vulkan VP decoding</p></li><li><p>Compute-based Vulkan FFv1 encoding-decoding and ProRes Raw decoding</p></li></ul><p>Hardware-accelerated means that Vulkan utilizes the underlying hardware&#8217;s capabilities to process specific video commands, while compute-based means that Vulkan uses compute shaders to perform commands (hardware-agnostic).</p><p>To install FFmpeg 8.0 with Vulkan, follow the instructions for <a href="https://www.rendi.dev/post/ffmpeg-8-0-part-1-using-whisper-for-native-video-transcription-in-ffmpeg">&#8220;How to install FFmpeg 8&#8221;</a>. The setup used is a Windows 11 Lenovo laptop with Nvidia RTX 4060 - Driver version 581.29, CUDA version 13.0</p><h3>Why is Vulkan interesting?</h3><p>For developers building video applications that should be supported across different hardware and platforms (for example, FFmpeg&#8217;s devs), Vulkan is a way to standardize code so you write it once and it works on Linux, Windows, Nvidia, AMD, Intel, and the rest. You don&#8217;t need to write special code for Nvidia&#8217;s CUDA or AMD&#8217;s VAAPI. Vulkan will help FFmpeg&#8217;s maintainers ship cross-platform code faster and more reliably.</p><p>If you are a FFmpeg user and want to decode and encode on specialized hardware, you will usually need a different FFmpeg command for each hardware platform (Nvidia CUDA, AMD VA-API, Intel QSV, etc.). With Vulkan, if your platform and hardware support it, you can specify one command and use it across different devices. It is not a large gain, because changing FFmpeg commands for each hardware platform is not a major issue.</p><h3>What are the limitations of Vulkan?</h3><p>It is not given that Vulkan will run on your platform. The hardware manufacturer needs to provide the required software drivers for the designated platform to support Vulkan, and you need to ensure the drivers you have installed are correct. For example, Nvidia&#8217;s drivers that support Vulkan for Linux and Windows, including their release notes, are here: <a href="https://developer.nvidia.com/vulkan-driver">https://developer.nvidia.com/vulkan-driver</a></p><p>Following are a few issues with Nvidia&#8217;s 57X drivers with Vulkan</p><ul><li><p><a href="https://forums.developer.nvidia.com/t/ffmpeg-vulkan-decoding-doesnt-work-rtx-5060-ti-575-57-08/335569">https://forums.developer.nvidia.com/t/ffmpeg-vulkan-decoding-doesnt-work-rtx-5060-ti-575-57-08/335569</a></p></li><li><p><a href="https://forums.developer.nvidia.com/t/575-release-feedback-discussion/330513/55">https://forums.developer.nvidia.com/t/575-release-feedback-discussion/330513/55</a></p></li></ul><p>Good <a href="https://github.com/mpv-player/mpv/discussions/13909">GitHub discussion</a> about Vulkan and stability issues with FFmpeg and MPV player.</p><p>To check which hardware and drivers support Vulkan, you can use <a href="https://vulkan.gpuinfo.org/listdevices.php">this community database</a>.</p><p>Vulkan doesn&#8217;t add functionality that does not exist on the underlying hardware. So older hardware will not support the new encoding/decoding. To check which Vulkan features your local system supports, use the <a href="https://vulkan.lunarg.com/doc/view/latest/windows/vulkaninfo.html">vulkaninfo </a>tool found in the <a href="https://vulkan.lunarg.com/sdk/home">Vulkan SDK</a>. Make sure to use Vulkan V1.3, as that&#8217;s the one shipped with FFmpeg.</p><p>For example, to check for support for AV1 encoding and decoding on Nvidia GPU:</p><pre><code>vulkaninfo.exe
....
GPU id : 0 (NVIDIA GeForce RTX 4060 Laptop GPU):
....
VK_KHR_video_decode_av1                       : extension revision 1
VK_KHR_video_encode_av1                       : extension revision 1</code></pre><h4>Vulkan performance</h4><p>There should not be a performance gain, and maybe even a small performance degradation, because your encoding and decoding commands will go through another abstraction layer before reaching the hardware.</p><p>Vulkan is another API standard for connecting application code to underlying GPU hardware, like VAAPI and others, as xkcd put it:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6058!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c240fe-5e80-4608-8974-29560d147459_999x567.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6058!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c240fe-5e80-4608-8974-29560d147459_999x567.png 424w, https://substackcdn.com/image/fetch/$s_!6058!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c240fe-5e80-4608-8974-29560d147459_999x567.png 848w, https://substackcdn.com/image/fetch/$s_!6058!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c240fe-5e80-4608-8974-29560d147459_999x567.png 1272w, https://substackcdn.com/image/fetch/$s_!6058!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c240fe-5e80-4608-8974-29560d147459_999x567.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6058!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c240fe-5e80-4608-8974-29560d147459_999x567.png" width="999" height="567" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/62c240fe-5e80-4608-8974-29560d147459_999x567.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:567,&quot;width&quot;:999,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6058!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c240fe-5e80-4608-8974-29560d147459_999x567.png 424w, https://substackcdn.com/image/fetch/$s_!6058!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c240fe-5e80-4608-8974-29560d147459_999x567.png 848w, https://substackcdn.com/image/fetch/$s_!6058!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c240fe-5e80-4608-8974-29560d147459_999x567.png 1272w, https://substackcdn.com/image/fetch/$s_!6058!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62c240fe-5e80-4608-8974-29560d147459_999x567.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>My experience with FFmpeg and Vulkan </h3><p>I tried utilizing the new Vulkan AV1 encoding and VP9 decoding, but unfortunately, these features did not work. Below is the full description of what worked and what didn&#8217;t.</p><p>All our experiments used the <a href="https://storage.rendi.dev/sample/big_buck_bunny_720p.mp4">Big Buck Bunny video</a> and its <a href="https://storage.rendi.dev/sample/big_buck_bunny_720p_16sec.mp4">16-second snippet</a>. </p><p>FFmpeg Vulkan commands are of the structure:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;8ff18a7a-3a5a-48bc-a3e9-f7abf1e079f9&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">ffmpeg -init_hw_device &#8220;vulkan=vk:1&#8221; -hwaccel vulkan -hwaccel_output_format vulkan ....</code></pre></div><p>To find the correct index of the GPU (<strong>vk:1</strong>), use the following command:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;962232a7-c353-450d-9ee6-420ad370e82b&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">./ffmpeg -init_hw_device &#8220;vulkan&#8221; -v verbose
...
[Vulkan @ 000001bdec619e00] Supported layers:
[Vulkan @ 000001bdec619e00]     VK_LAYER_NV_optimus
[Vulkan @ 000001bdec619e00]     VK_LAYER_NV_present
[Vulkan @ 000001bdec619e00] GPU listing:
[Vulkan @ 000001bdec619e00]     0: Intel(R) Arc(TM) Graphics (integrated) (0x7d55)
[Vulkan @ 000001bdec619e00]     1: NVIDIA GeForce RTX 4060 Laptop GPU (discrete) (0x28a0)
[Vulkan @ 000001bdec619e00] Device 0 selected: Intel(R) Arc(TM) Graphics (integrated) (0x7d55)
...</code></pre></div><h4>Encode AV1 with FFmpeg Vulkan</h4><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;9d6cf599-0e6f-404a-8a8d-3cb1910fa162&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">./ffmpeg -init_hw_device &#8220;vulkan=vk:1&#8221; -hwaccel vulkan -hwaccel_output_format vulkan -i big_buck_bunny_720p_16sec.mp4 -c:v av1_vulkan output_av1.mkv
...
[vost#0:0/av1_vulkan @ 0000029a719635c0] Non-monotonic DTS; previous: 125, current: 42; changing to 125. This may result in incorrect timestamps in the output file.
[vost#0:0/av1_vulkan @ 0000029a719635c0] Non-monotonic DTS; previous: 125, current: 83; changing to 125. This may result in incorrect timestamps in the output file.
Unable to submit command buffer: VK_ERROR_DEVICE_LOST
[h264 @ 0000029a6c81e540] [vk @ 0000029a755b9e80] Unable to submit command buffer: VK_ERROR_DEVICE_LOST
[h264 @ 0000029a6c82d240] hardware accelerator failed to decode picture
Unable to submit command buffer: VK_ERROR_DEVICE_LOST
[h264 @ 0000029a74db53c0] get_buffer() failed
[h264 @ 0000029a74db53c0] thread_get_buffer() failed
[h264 @ 0000029a74db53c0] no frame!
Unable to submit command buffer: VK_ERROR_DEVICE_LOST
[h264 @ 0000029a74db5000] get_buffer() failed
[h264 @ 0000029a74db5000] thread_get_buffer() failed
[h264 @ 0000029a74db5000] no frame!
Unable to submit command buffer: VK_ERROR_DEVICE_LOST
[h264 @ 0000029a74db5780] get_buffer() failed
[h264 @ 0000029a74db5780] thread_get_buffer() failed
[h264 @ 0000029a74db5780] no frame!</code></pre></div><p>The command hangs and doesn&#8217;t create the desired output.</p><p>I was not able to re-encode the H264 video to AV1 using Vulkan, no matter what I tried. I opened this <a href="https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/20540">ticket</a> in FFmpeg Forgejo based on Gyan&#8217;s instructions.</p><p>Running nvenv to re-encode to AV1 worked fine:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;3c4e7586-403f-4cca-83a1-10d53ee394cb&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">./ffmpeg -i big_buck_bunny_720p.mp4 -c:v av1_nvenc output.mkv</code></pre></div><p>If you&#8217;re already using av1_nvenc, just keep using it; there&#8217;s no reason to switch to Vulkan.</p><p>Decoding AV1 with Vulkan (supported in the previous FFmpeg version) and encoding to h264 with CUDA also worked fine:</p><pre><code>./ffmpeg -init_hw_device &#8220;vulkan=vk:1&#8221; -hwaccel vulkan -i big_buck_bunny_720p_av1.mkv -c:v h264_nvenc -c:a aac output.mp4 
...
[out#0/mp4 @ 000001e789517940] video:147136KiB audio:9423KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.259145% frame=14315 fps=769 q=17.0 Lsize=  156965KiB time=00:09:56.33 bitrate=2156.3kbits/s speed=  32x elapsed=0:00:18.61
[aac @ 000001e78efaa100] Qavg: 541.575</code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8shY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdd885c-6698-49cb-959c-e863c923c657_3071x1824.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8shY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdd885c-6698-49cb-959c-e863c923c657_3071x1824.png 424w, https://substackcdn.com/image/fetch/$s_!8shY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdd885c-6698-49cb-959c-e863c923c657_3071x1824.png 848w, https://substackcdn.com/image/fetch/$s_!8shY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdd885c-6698-49cb-959c-e863c923c657_3071x1824.png 1272w, https://substackcdn.com/image/fetch/$s_!8shY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdd885c-6698-49cb-959c-e863c923c657_3071x1824.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8shY!,w_2400,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdd885c-6698-49cb-959c-e863c923c657_3071x1824.png" width="1200" height="712.9120879120879" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0fdd885c-6698-49cb-959c-e863c923c657_3071x1824.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;large&quot;,&quot;height&quot;:865,&quot;width&quot;:1456,&quot;resizeWidth&quot;:1200,&quot;bytes&quot;:381759,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.peternaf.com/i/191017209?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdd885c-6698-49cb-959c-e863c923c657_3071x1824.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-large" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8shY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdd885c-6698-49cb-959c-e863c923c657_3071x1824.png 424w, https://substackcdn.com/image/fetch/$s_!8shY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdd885c-6698-49cb-959c-e863c923c657_3071x1824.png 848w, https://substackcdn.com/image/fetch/$s_!8shY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdd885c-6698-49cb-959c-e863c923c657_3071x1824.png 1272w, https://substackcdn.com/image/fetch/$s_!8shY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdd885c-6698-49cb-959c-e863c923c657_3071x1824.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Decode VP9 with FFmpeg Vulkan</h4><p><em>&#8220;Hardware-accelerated VP9 decoding support nowadays is ubiquitous, as most GPUs and SoCs support it natively. Hardware encoding is present in Intel&#8217;s Kaby Lake processors and above.&#8221;</em><br><a href="https://en.wikipedia.org/wiki/VP9">https://en.wikipedia.org/wiki/VP9</a></p><p>VP9 Vulkan decoding and re-encoding with CUDA:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;37e1bc83-518d-4195-b2da-b757cda1e316&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">./ffmpeg  -init_hw_device &#8220;vulkan=vk:1&#8221; -hwaccel vulkan -i big_buck_bunny_720p_16sec.webm -c:v h264_nvenc -c:a aac output.mp4
...
[opus @ 0000020467207f00] Error parsing Opus packet header.0 bitrate=2207.6kbits/s speed=18.6x elapsed=0:00:00.51
[out#0/mp4 @ 000002046178d840] video:3846KiB audio:256KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.299111%
frame=  384 fps=0.0 q=15.0 Lsize=    4115KiB time=00:00:15.87 bitrate=2123.3kbits/s speed=23.5x elapsed=0:00:00.67
[aac @ 00000204674ffac0] Qavg: 541.625</code></pre></div><p>VP9 Vulkan decoding and re-encoding with CPU:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;6f7ec420-6463-422d-a238-4e9063cf3d9f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">./ffmpeg  -init_hw_device &#8220;vulkan=vk:1&#8221; -hwaccel vulkan -i big_buck_bunny_720p_16sec.webm  -c:v libx264   -c:a aac output.mp4
...
[opus @ 000001fe5ed87200] Error parsing Opus packet header.1 bitrate=1336.3kbits/s speed=9.18x elapsed=0:00:01.02
[out#0/mp4 @ 000001fe5990e040] video:2401KiB audio:256KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.450978%
frame=  384 fps=267 q=-1.0 Lsize=    2670KiB time=00:00:15.91 bitrate=1374.0kbits/s speed=11.1x elapsed=0:00:01.43
...</code></pre></div><p>Both commands above created a malformed output video with artifacts:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!m-eV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e3adb68-deb6-468b-81dc-75427e4c0fac_2123x1195.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!m-eV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e3adb68-deb6-468b-81dc-75427e4c0fac_2123x1195.png 424w, https://substackcdn.com/image/fetch/$s_!m-eV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e3adb68-deb6-468b-81dc-75427e4c0fac_2123x1195.png 848w, https://substackcdn.com/image/fetch/$s_!m-eV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e3adb68-deb6-468b-81dc-75427e4c0fac_2123x1195.png 1272w, https://substackcdn.com/image/fetch/$s_!m-eV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e3adb68-deb6-468b-81dc-75427e4c0fac_2123x1195.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!m-eV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e3adb68-deb6-468b-81dc-75427e4c0fac_2123x1195.png" width="1456" height="820" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9e3adb68-deb6-468b-81dc-75427e4c0fac_2123x1195.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:820,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:3069997,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.peternaf.com/i/191017209?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e3adb68-deb6-468b-81dc-75427e4c0fac_2123x1195.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!m-eV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e3adb68-deb6-468b-81dc-75427e4c0fac_2123x1195.png 424w, https://substackcdn.com/image/fetch/$s_!m-eV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e3adb68-deb6-468b-81dc-75427e4c0fac_2123x1195.png 848w, https://substackcdn.com/image/fetch/$s_!m-eV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e3adb68-deb6-468b-81dc-75427e4c0fac_2123x1195.png 1272w, https://substackcdn.com/image/fetch/$s_!m-eV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e3adb68-deb6-468b-81dc-75427e4c0fac_2123x1195.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Re-encoding VP9 to H264 with CUDA worked well, without creating artifacts:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;592b1258-dbfb-4e06-b7d9-3ee7a9b4c400&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">./ffmpeg -init_hw_device cuda -hwaccel cuda -i big_buck_bunny_720p_16sec.webm -c:v h264_nvenc -c:a aac output.mp4
...
[opus @ 0000021cf6b15780] Error parsing Opus packet header.2 bitrate=2178.9kbits/s speed=19.1x elapsed=0:00:00.50
[out#0/mp4 @ 0000021ce78e8c00] video:3718KiB audio:256KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.308708%
frame=  384 fps=0.0 q=12.0 Lsize=    3987KiB time=00:00:15.87 bitrate=2057.5kbits/s speed=24.4x elapsed=0:00:00.65
[aac @ 0000021cf6bb9240] Qavg: 541.625</code></pre></div><p>If you were using CUDA previously, just continue using that and don&#8217;t switch to Vulkan.</p><h4>About my runtime environment:</h4><p>My setup is a Windows 11 Lenovo laptop with Nvidia RTX 4060 - Driver version 581.29, CUDA version 13.0</p><ul><li><p>Based on <a href="https://developer.nvidia.com/vulkan/video/get-started">this link</a>, you need a minimum Nvidia driver 550.23 </p></li><li><p>Based on the <a href="https://vulkan.gpuinfo.org/listreports.php?devicename=NVIDIA+GeForce+RTX+4060+Laptop+GPU">Vulkan community</a>, the minimum Nvidia driver version for Vulkan V1.3 is 527 </p></li><li><p>I tried downgrading our Nvidia driver to version 577, but saw the same results</p></li></ul><h5>FFmpeg Vulkan on WSL </h5><p>To test FFmpeg 8.0 on WSL, I downloaded the N-121064-g424d844534-linux64-gpl build from FFmpeg-Builds, running it on WSL Ubuntu 24.04</p><p>FFmpeg Vulkan did not recognize the Nvidia GPU</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;e7878911-d498-428d-a1f2-582e5404bf56&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">./ffmpeg -init_hw_device &#8220;vulkan&#8221; -v verbose
...
[Vulkan @ 0x55f0b44205c0] Supported layers:
[Vulkan @ 0x55f0b44205c0]       VK_LAYER_MESA_device_select
[Vulkan @ 0x55f0b44205c0]       VK_LAYER_MESA_overlay
[Vulkan @ 0x55f0b44205c0]       VK_LAYER_INTEL_nullhw
[Vulkan @ 0x55f0b44205c0] GPU listing:
[Vulkan @ 0x55f0b44205c0]     0: llvmpipe (LLVM 19.1.1, 256 bits) (software) (0x0)
[Vulkan @ 0x55f0b44205c0] Device 0 selected: llvmpipe (LLVM 19.1.1, 256 bits) (software) (0x0)
...</code></pre></div><p>nvidia-smi did recognize the Nvidia GPU:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!t97g!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdef3f6d-28ff-4b68-a151-38d61c905050_1756x782.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!t97g!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdef3f6d-28ff-4b68-a151-38d61c905050_1756x782.png 424w, https://substackcdn.com/image/fetch/$s_!t97g!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdef3f6d-28ff-4b68-a151-38d61c905050_1756x782.png 848w, https://substackcdn.com/image/fetch/$s_!t97g!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdef3f6d-28ff-4b68-a151-38d61c905050_1756x782.png 1272w, https://substackcdn.com/image/fetch/$s_!t97g!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdef3f6d-28ff-4b68-a151-38d61c905050_1756x782.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!t97g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdef3f6d-28ff-4b68-a151-38d61c905050_1756x782.png" width="1456" height="648" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cdef3f6d-28ff-4b68-a151-38d61c905050_1756x782.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:648,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51516,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.peternaf.com/i/191017209?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdef3f6d-28ff-4b68-a151-38d61c905050_1756x782.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!t97g!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdef3f6d-28ff-4b68-a151-38d61c905050_1756x782.png 424w, https://substackcdn.com/image/fetch/$s_!t97g!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdef3f6d-28ff-4b68-a151-38d61c905050_1756x782.png 848w, https://substackcdn.com/image/fetch/$s_!t97g!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdef3f6d-28ff-4b68-a151-38d61c905050_1756x782.png 1272w, https://substackcdn.com/image/fetch/$s_!t97g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdef3f6d-28ff-4b68-a151-38d61c905050_1756x782.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Running nvenc on the GPU encoding worked fine:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;820df066-b440-4ec5-8993-0a887ea7f2b9&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">./ffmpeg -i big_buck_bunny_720p.mp4 -c:v av1_nvenc output.mkv</code></pre></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!efTg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59870d73-0b2a-4f06-997c-d6b9f9b6747d_3071x1817.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!efTg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59870d73-0b2a-4f06-997c-d6b9f9b6747d_3071x1817.png 424w, https://substackcdn.com/image/fetch/$s_!efTg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59870d73-0b2a-4f06-997c-d6b9f9b6747d_3071x1817.png 848w, https://substackcdn.com/image/fetch/$s_!efTg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59870d73-0b2a-4f06-997c-d6b9f9b6747d_3071x1817.png 1272w, https://substackcdn.com/image/fetch/$s_!efTg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59870d73-0b2a-4f06-997c-d6b9f9b6747d_3071x1817.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!efTg!,w_2400,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59870d73-0b2a-4f06-997c-d6b9f9b6747d_3071x1817.png" width="1200" height="709.6153846153846" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/59870d73-0b2a-4f06-997c-d6b9f9b6747d_3071x1817.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;large&quot;,&quot;height&quot;:861,&quot;width&quot;:1456,&quot;resizeWidth&quot;:1200,&quot;bytes&quot;:389162,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.peternaf.com/i/191017209?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59870d73-0b2a-4f06-997c-d6b9f9b6747d_3071x1817.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-large" alt="" srcset="https://substackcdn.com/image/fetch/$s_!efTg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59870d73-0b2a-4f06-997c-d6b9f9b6747d_3071x1817.png 424w, https://substackcdn.com/image/fetch/$s_!efTg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59870d73-0b2a-4f06-997c-d6b9f9b6747d_3071x1817.png 848w, https://substackcdn.com/image/fetch/$s_!efTg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59870d73-0b2a-4f06-997c-d6b9f9b6747d_3071x1817.png 1272w, https://substackcdn.com/image/fetch/$s_!efTg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59870d73-0b2a-4f06-997c-d6b9f9b6747d_3071x1817.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div>]]></content:encoded></item><item><title><![CDATA[FFmpeg 8.0 (Part 1): Using Whisper for Native Video Transcription in FFmpeg]]></title><description><![CDATA[Original blog post published in Rendi]]></description><link>https://www.peternaf.com/p/ffmpeg-8-0-part-1-using-whisper-for-native-video-transcription-in-ffmpeg</link><guid isPermaLink="false">https://www.peternaf.com/p/ffmpeg-8-0-part-1-using-whisper-for-native-video-transcription-in-ffmpeg</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Wed, 18 Mar 2026 11:03:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/3400328b-6ab0-4060-bf91-ebffa6562e16_1455x1080.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em><a href="https://www.rendi.dev/post/ffmpeg-8-0-part-1-using-whisper-for-native-video-transcription-in-ffmpeg?utm_source=peternaf.com">Original blog post published in Rendi</a></em></p><p>The most exciting feature in ffmpeg 8.0 is native support for Whisper, a free and open-source speech recognition library developed by OpenAI. FFmpeg&#8217;s Whisper integration enables you to use a single tool for transcribing video, adding subtitles, or automatically extracting highlights. It&#8217;s fast enough that you can even do it in real time on a streaming video.</p><p>FFmpeg is a free and powerful tool that enables you to easily convert, compress, or transcode nearly any video or audio format with a single command.</p><p>This post is part of a series of posts about the new <a href="https://ffmpeg.org/index.html#pr8.0">FFmpeg 8.0</a> release:</p><ol><li><p><a href="https://peternaf.com/p/ffmpeg-8-0-part-2-how-to-use-pad-cuda">FFmpeg 8.0 (Part 2): How to use pad_cuda</a></p></li><li><p><a href="https://peternaf.com/p/ffmpeg-8-0-part-3-failed-attempts-to-use-vulkan-for-av1-encoding-vp9-decoding">FFmpeg 8.0 (Part 3): Failed attempts to use Vulkan for AV1 Encoding &amp; VP9 Decoding</a></p></li></ol><p>This post covers:</p><ul><li><p>FFmpeg + Whisper Demo</p></li><li><p>Installing FFmpeg 8.0 with Whisper on Windows</p></li><li><p>Explaining the new FFmpeg 8.0 Whisper filter</p></li><li><p>Review and benchmarks of Whisper transcription with FFmpeg</p></li><li><p>Real-time video stream transcription with FFmpeg</p></li><li><p>Voice activation detection (VAD) in FFmepg</p></li></ul><h2>Adding subtitles to a video with two FFmpeg commands</h2><div class="native-video-embed" data-component-name="VideoPlaceholder" data-attrs="{&quot;mediaUploadId&quot;:&quot;4f8a3eed-2d17-4701-b23f-6548020df0de&quot;,&quot;duration&quot;:null}"></div><p>These are the two FFmpeg commands used to add subtitles to the video (<a href="https://storage.rendi.dev/sample/popeye_meets_sinbad.mp4">link to source video</a>):</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;ea3e4766-e52d-47e9-8013-391c99e2636f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">./ffmpeg -i popeye_meets_sinbad.mp4 -vn -af &#8220;whisper=model=ggml-medium.en.bin:language=en:queue=30:destination=popey_whisper_medium.srt:format=srt&#8221; -f null -

./ffmpeg -i popeye_meets_sinbad.mp4 -vf &#8220;subtitles=popey_whisper_medium.srt:force_style=&#8217;BackColour=&amp;H80000000,BorderStyle=4,Outline=0,Shadow=0,Fontsize=24,MarginV=25&#8217;&#8221; -c:a copy popeye_meets_sinbad_subtitled.mp4</code></pre></div><p>In this post, I will explain how you can do it yourself.</p><h2>Why is the Whisper FFmpeg filter interesting?</h2><ul><li><p>You can use one tool for transcription and subtitle burning by utilizing the Whisper filter to create an SRT file, a standard subtitle format, which you can then write to a video (burn) with FFmpeg.</p></li><li><p>Whisper supports WAV and MP3 files. You usually need to install FFmpeg along with Whisper to support different video and audio formats. Having Whisper ship as part of FFmpeg automatically creates support for the various media formats.</p></li><li><p>It is straightforward to transcribe video streams in near real-time (see example below)</p></li><li><p>You can use the output from FFmpeg-Whisper, run it through your favorite LLM to extract highlight timestamps from the original video, and use FFmpeg again to trim out clips based on these highlights.</p></li></ul><h2>How to install FFmpeg 8 with Whisper on Windows</h2><h3>Getting FFmpeg 8.0</h3><p>I used the November 15 pre-compiled GPL version of FFmpeg 8.0 with Whisper (and Vulkan) for Windows from <a href="https://github.com/BtbN/FFmpeg-Builds">FFmpeg-Builds</a>:</p><ol><li><p>Log in to GitHub</p></li><li><p>Go to <a href="https://github.com/BtbN/FFmpeg-Builds/actions">https://github.com/BtbN/FFmpeg-Builds/actions</a></p></li><li><p>For the latest build, pick the file below named &#8220;ffmpeg-win64-gpl&#8221;</p></li><li><p>To check which FFmpeg version this build corresponds to, you can take the seven characters of the commit code, after the &#8216;g&#8217; character in the build&#8217;s version, and insert them into this URL:</p></li></ol><pre><code><a href="https://git.ffmpeg.org/gitweb/ffmpeg.git/blob_plain/1ce88d2:/RELEASE">https://git.ffmpeg.org/gitweb/ffmpeg.git/blob_plain/1ce88d2:/RELEASE</a>

8.0.git</code></pre><p><em><strong>Those interested in compiling FFmpeg 8.0 themselves, some resources to get you started:</strong></em></p><ul><li><p>FFmpeg 8.0 is built with a link to the compiled Whisper version (version 1.7.5 or later). Due to the high frequency of Whisper updates, providing FFmpeg with the compiled Whisper version enables updating to future, improved Whisper versions while maintaining the same FFmpeg version. <a href="https://www.reddit.com/r/ffmpeg/comments/1my2laj/using_whisper_filter_in_ffmpeg_8/">Good Reddit thread about compiling FFmpeg 8 with Whisper</a></p></li><li><p><a href="https://www.reddit.com/r/ffmpeg/comments/1my2laj/using_whisper_filter_in_ffmpeg_8/">Helpful Reddit thread with compilation issues and instructions</a></p></li><li><p>Official compilation docs (a bit outdated) <a href="https://trac.ffmpeg.org/wiki/CompilationGuide">https://trac.ffmpeg.org/wiki/CompilationGuide</a> <a href="https://trac.ffmpeg.org/wiki/CompilationGuide/WinRT">https://trac.ffmpeg.org/wiki/CompilationGuide/WinRT</a> </p></li><li><p>All the build information and tutorials I found online were inconsistent, especially with the new introduction of FFmpeg 8.0 + Whisper build. It&#8217;s best to reverse-engineer the FFmpeg-Builds compilation script; the code is clear, well-organized, and works.</p></li></ul><h3>Get the OpenAI Whisper models</h3><p>OpenAI&#8217;s C/C++ based Whisper open-source project includes language models for transcribing audio to text. It is hosted in ggml&#8217;s repository, an open-source machine learning library written in C/C++ with a focus on Transformer inference. </p><p>To download the Whisper models, get this <a href="https://github.com/ggml-org/whisper.cpp/blob/master/models/download-ggml-model.cmd">script</a> from Whisper.cpp:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;11084edb-1521-4509-ac53-2b266c7742b9&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash"># Download base.en medium.en and large models
./download-ggml-model.cmd base.en
...
ggml-base.en.bin

./download-ggml-model.cmd medium.en
...
ggml-medium.en.bin

./download-ggml-model.cmd large-v3
...
ggml-large-v3.bin</code></pre></div><h4>About the models</h4><p><em><a href="https://github.com/ggml-org/whisper.cpp/blob/master/models/README.md">&#8220;Models are multilingual unless the model name includes .en. Models ending in -q5_0 are quantized. Models ending in -tdrz support local diarization (marking of speaker turns) using tinydiarize.&#8221;</a></em></p><p>I attempted to run FFmpeg with the Whisper ggml-small.en-tdrz.bin model for speaker recognition, but it did not work as expected. Therefore, I omit this model from the rest of the post.</p><blockquote><p>All the experiments run over a Windows 11 Lenovo laptop with Nvidia RTX 4060 - Driver version 581.29, CUDA version 13.0</p></blockquote><h2>Transcribing a video with FFmpeg and Whisper</h2><p>For testing, I used the video <a href="https://storage.rendi.dev/sample/popeye_sinbad.mp4">Popeye the Sailor Meets Sinbad the Sailor,</a> released to the public domain by the <a href="https://www.loc.gov/item/2023602008/">Library of Congress</a>.</p><blockquote><p>More about the whisper filter and its parameters in <a href="https://ffmpeg.org/ffmpeg-filters.html#whisper-1">FFmpeg&#8217;s documentation</a></p></blockquote><p>Following, I run an FFmpeg Whisper command with the Base English model, sending whisper audio chunks (queue) of 30 seconds and outputting SRT subtitles format<strong> </strong>to the output destination SRT file:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;c6f944f1-0fb1-444f-9483-d6cfda7e8fa2&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">$INPUT_FILE=&#8221;popeye_sinbad.mp4&#8221;
$OUTPUT_FILE=&#8221;popey_whisper_base.srt&#8221;

$MODEL=&#8221;ggml-base.en.bin&#8221; #whisper model
$LANGUAGE=&#8221;en&#8221;
$QUEUE=&#8221;30&#8221; #Size of audio chunks to send to whisper (seconds)
$FORMAT=&#8221;srt&#8221; #Other possible output formats are json and txt

./ffmpeg -i $INPUT_FILE -vn -af &#8220;whisper=model=&#8217;$MODEL&#8217;:language=&#8217;$LANGUAGE&#8217;:queue=&#8217;$QUEUE&#8217;:destination=&#8217;$OUTPUT_FILE&#8217;:format=&#8217;$FORMAT&#8217;&#8221; -f null -</code></pre></div><p><a href="https://storage.rendi.dev/blog/popey_whisper_base.srt">popey_whisper_base.srt</a> snippet:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;60950c56-f823-4589-8272-a1b75eef367d&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">0
00:00:00,000 --&gt; 00:00:02,980
[MUSIC PLAYING]

1
00:00:29,994 --&gt; 00:00:32,494
(tense music)

2
00:00:59,988 --&gt; 00:01:06,988
[screaming]

3
00:01:06,988 --&gt; 00:01:08,988
[grunting]

4
00:01:08,988 --&gt; 00:01:11,988
[grunting]

5
00:01:11,988 --&gt; 00:01:15,988
I&#8217;m sitting down to say this so hardy and hail.

6
00:01:15,988 --&gt; 00:01:18,988
I live on an island on the back of a whale.

7
00:01:18,988 --&gt; 00:01:22,988
It&#8217;s a whale of an island. That&#8217;s not a bad joke.</code></pre></div><p>Immediately, you can see that Whisper annotates the sound even if there is no speech, with music, screaming, and other audio artifacts. This works both for the Base and Medium English models. The multilingual large model does not annotate sounds.</p><blockquote><p>To burn the SRT subtitles to the video using FFmpeg you can <a href="https://github.com/rendi-api/ffmpeg-cheatsheet/blob/main/README.md#%EF%B8%8F-add-subtitles-to-a-video">follow our cheat sheet</a> or use GPT.</p></blockquote><h4>More useful flags:</h4><ul><li><p><strong>format=json </strong>creates a JSON-style file with timestamps and transcription, similarly to SRT.</p></li><li><p><strong>format=text</strong> transcribes the speech to text without timestamps</p></li><li><p>By default, Whisper uses your system&#8217;s GPU. To disable it, specify <strong>use_gpu=false</strong>. This will result in much slower processing time.</p></li></ul><p>People online remark that whisper models can hallucinate speech when it does not exist in the original audio. I did not see hallucinations in my tests. I have also tested the <a href="https://storage.rendi.dev/sample/big_buck_bunny_720p.mp4 ">Big Buck Bunny video</a>, which does not contain any speech, and the results with the ggml-base.en.bin model were very clean, with no hallucinations. <a href="https://storage.rendi.dev/blog/bigbunny_whisper.json">Output: JSON file</a>.</p><p>In case you see -transcription- hallucinations, you can use the VAD model (explained below)</p><h3>Performance benchmarks of the three whisper models</h3><p>Expectantly, the larger the model, the more GPU resources it utilizes:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YRNq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8277595-cf98-497a-8621-44e533e47088_776x486.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YRNq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8277595-cf98-497a-8621-44e533e47088_776x486.png 424w, https://substackcdn.com/image/fetch/$s_!YRNq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8277595-cf98-497a-8621-44e533e47088_776x486.png 848w, https://substackcdn.com/image/fetch/$s_!YRNq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8277595-cf98-497a-8621-44e533e47088_776x486.png 1272w, https://substackcdn.com/image/fetch/$s_!YRNq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8277595-cf98-497a-8621-44e533e47088_776x486.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YRNq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8277595-cf98-497a-8621-44e533e47088_776x486.png" width="728" height="455.9381443298969" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d8277595-cf98-497a-8621-44e533e47088_776x486.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:486,&quot;width&quot;:776,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;% of GPU utilization by Whisper model&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="% of GPU utilization by Whisper model" title="% of GPU utilization by Whisper model" srcset="https://substackcdn.com/image/fetch/$s_!YRNq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8277595-cf98-497a-8621-44e533e47088_776x486.png 424w, https://substackcdn.com/image/fetch/$s_!YRNq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8277595-cf98-497a-8621-44e533e47088_776x486.png 848w, https://substackcdn.com/image/fetch/$s_!YRNq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8277595-cf98-497a-8621-44e533e47088_776x486.png 1272w, https://substackcdn.com/image/fetch/$s_!YRNq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8277595-cf98-497a-8621-44e533e47088_776x486.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">% of GPU utilization by Whisper model</figcaption></figure></div><p>I also tested the total processing time over the full Popeye video (15:50 minutes) and reported the results as ratios of processing time to video time for GPU-enabled (GPU speed) and GPU-disabled (CPU speed) runs. 1x means processing took 15:50 minutes:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pHIS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d271fd-5376-4160-9364-a0a7e54092bf_796x490.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pHIS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d271fd-5376-4160-9364-a0a7e54092bf_796x490.png 424w, https://substackcdn.com/image/fetch/$s_!pHIS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d271fd-5376-4160-9364-a0a7e54092bf_796x490.png 848w, https://substackcdn.com/image/fetch/$s_!pHIS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d271fd-5376-4160-9364-a0a7e54092bf_796x490.png 1272w, https://substackcdn.com/image/fetch/$s_!pHIS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d271fd-5376-4160-9364-a0a7e54092bf_796x490.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pHIS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d271fd-5376-4160-9364-a0a7e54092bf_796x490.png" width="796" height="490" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c8d271fd-5376-4160-9364-a0a7e54092bf_796x490.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:490,&quot;width&quot;:796,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Processing time as a multiplier of video duration&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Processing time as a multiplier of video duration" title="Processing time as a multiplier of video duration" srcset="https://substackcdn.com/image/fetch/$s_!pHIS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d271fd-5376-4160-9364-a0a7e54092bf_796x490.png 424w, https://substackcdn.com/image/fetch/$s_!pHIS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d271fd-5376-4160-9364-a0a7e54092bf_796x490.png 848w, https://substackcdn.com/image/fetch/$s_!pHIS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d271fd-5376-4160-9364-a0a7e54092bf_796x490.png 1272w, https://substackcdn.com/image/fetch/$s_!pHIS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8d271fd-5376-4160-9364-a0a7e54092bf_796x490.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Processing time as a multiplier of video duration</figcaption></figure></div><p>The base and medium English models have audio annotations for different sounds. The large model, which is multi-lingual, doesn&#8217;t have annotations; instead, music notes mark for differing sounds - json output of large model <a href="https://storage.rendi.dev/blog/popey_whisper_largev3.json">popey_whisper_largev3.json</a></p><h2>Real-time video stream transcription</h2><p>You can use FFmpeg to transcribe microphone, HTTP Live Streaming (HLS), and Secure Reliable Transport (SRT) stream.</p><blockquote><p><strong>HLS </strong>is a widely used media streaming protocol that delivers video and audio content over standard HTTP web servers. Developed by Apple, it works by breaking a media file or live stream into a sequence of small, downloadable segments (typically a few seconds long) and creating an index file (with a .m3u8 extension) that lists the order and location of these segments.</p></blockquote><blockquote><p><strong>SRT </strong>protocol is used to deliver video and audio with high quality and low latency over unreliable networks like the public internet. SRT streams.<br>The term is ambiguous, it could mean subtitles format or streaming protocol. I will be using it to mean subtitles format.</p></blockquote><p>Following is a screen recording of real-time SRT transcription of a live HLS video stream:</p><div class="native-video-embed" data-component-name="VideoPlaceholder" data-attrs="{&quot;mediaUploadId&quot;:&quot;1c5af2b3-6e90-4ad5-868a-ede566c85d9b&quot;,&quot;duration&quot;:null}"></div><p>I started playing the video with FFplay (FFmpeg&#8217;s media player) at the same time with the FFmpeg command:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;6c848ee2-26e4-46ad-8a82-fa2512443a6d&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">./ffmpeg -live_start_index -1 -i https://livecmaftest1.akamaized.net/cmaf/live/2099281/abr6s/master.m3u8 -vn -af &#8220;whisper=model=ggml-base.en.bin:language=en:queue=3:destination=-:format=srt&#8221; -f null -</code></pre></div><p>The FFplay command:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;7441c970-edfe-4d7b-bcd9-8e6e4ee2a7a0&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">ffplay -live_start_index -1 -i https://livecmaftest1.akamaized.net/cmaf/live/2099281/abr6s/master.m3u8</code></pre></div><p>Both commands are running from the last TS chunk of the HLS stream due to the &#8220;-live_start_index -1&#8221; parameter. </p><p>I added &#8220;destination=-:format=srt&#8221; to output the SRT transcription directly to the terminal.</p><p>With queue=3, I experience a 3-second delay in addition to the HLS stream. The transcription processing time for the base model, ggml-base.en.bin, is below 3 seconds, so it is not the delay factor. Over time, because the transcription is so fast, even with the 3-second batch size, the transcription outpaces the video.</p><h2>Voice activation detection - vad_model </h2><p>VAD can be beneficial for:</p><ol><li><p>Handling hallucinations - If you find that the speech-to-text model hallucinates text while there is no speech in the video, you can use the VAD model to make sure only to pass audio with speech to the model.</p></li><li><p>Pre-processing the audio before sending it to the speech-to-text model - For better transcription results. But, judging by what I saw, even the basic model is so good that it is not required to use the VAD model.</p></li></ol><p>You can download the Whisper VAD model using this <a href="https://github.com/ggml-org/whisper.cpp/blob/master/models/download-vad-model.cmd">script</a>.</p><p>I attempted to use the VAD model to speed up video stream transcription via audio chunking; however, I observed no increase in transcription speed. With queue=30, the queue parameter still took effect, and each batch took 30 seconds to get transcriptions.</p><p>Thanks, <a href="https://medium.com/@vpalmisano/run-whisper-audio-transcriptions-with-one-ffmpeg-command-c6ecda51901f">Vittorio Palmisano,</a> for a nice first overview of FFmpeg and Whisper capabilities.</p><h2>Closing remarks</h2><p>FFmpeg 8.0 includes more filters, encoders, and decoders, as well as security updates. You can read more about them in the <a href="https://ffmpeg.org/index.html#pr8.0">official release message</a> and the version 8 <a href="https://git.ffmpeg.org/gitweb/ffmpeg.git/blob_plain/refs/tags/n8.0:/Changelog">changelog</a>.</p><p>If you want more info, want us to check something else, or if anything was unclear in the post, let us know in the comments below.</p>]]></content:encoded></item><item><title><![CDATA[From 2D to 3D Using Neural Nets technical online lecture]]></title><description><![CDATA[In this talk we present a new artificial intelligence implementation which takes as input a 2D image and automatically reconstructs a 3D model.]]></description><link>https://www.peternaf.com/p/from-2d-to-3d-using-neural-nets-technical-online-lecture</link><guid isPermaLink="false">https://www.peternaf.com/p/from-2d-to-3d-using-neural-nets-technical-online-lecture</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Thu, 18 Jun 2020 08:05:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/youtube/w_728,c_limit/u7j4f6U7FJ4" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div id="youtube2-u7j4f6U7FJ4" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;u7j4f6U7FJ4&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/u7j4f6U7FJ4?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>In this talk we present a new artificial intelligence implementation which takes as input a 2D image and automatically reconstructs a 3D model. The reconstruction can happen in any resolution. We see how this same architecture combined with a generative adversarial network (GAN), similar in type to the network use for deep-fake, can be used to generate new 3D models.</p><p>We discuss some of the challenges with 3D modelling and AI, we will present cool implementations of AI in visualization, texture analysis and 3D modelling.</p><p>PDF of the talk:</p><div class="file-embed-wrapper" data-component-name="FileToDOM"><div class="file-embed-container-reader"><div class="file-embed-container-top"><image class="file-embed-thumbnail-default" src="https://substackcdn.com/image/fetch/$s_!0Cy0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack.com%2Fimg%2Fattachment_icon.svg"></image><div class="file-embed-details"><div class="file-embed-details-h1">2d To 3d Technical Lecture Public</div><div class="file-embed-details-h2">5.76MB &#8729; PDF file</div></div><a class="file-embed-button wide" href="https://www.peternaf.com/api/v1/file/749e2624-f129-45ed-95b4-f5b1ad7f973e.pdf"><span class="file-embed-button-text">Download</span></a></div><a class="file-embed-button narrow" href="https://www.peternaf.com/api/v1/file/749e2624-f129-45ed-95b4-f5b1ad7f973e.pdf"><span class="file-embed-button-text">Download</span></a></div></div><p>During the talk, I followed the implicit decoder research:<br>Open source code of the research (including trained network and datasets)<br>https://github.com/czq142857/implicit-decoder</p><p>My own two blog posts about the research:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;d6243e62-0b49-4520-8fc5-3d8b4e5856e5&quot;,&quot;caption&quot;:&quot;Back again with another AI and 3D reconstruction post for you This time, a special article, with many cool discoveries, I might write following posts about it. This is the highest quality 3D reconstruction from 1 image research I have seen yet. An encoding-decoding type of neural network to encode the 3D structure of a shape from a 2D image and then de&#8230;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Implicit-Decoder part 1 &#8211; 3D reconstruction&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:57204161,&quot;name&quot;:&quot;Peter Naftaliev&quot;,&quot;bio&quot;:&quot;Software engineer, entrepreneur | \&quot;The sculpture is already complete within the marble block, before I start my work. It is already there, I just have to chisel away the superfluous material.\&quot; Michelangelo [not the turtle] &quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5b34314b-8678-4d52-a950-76a8e7d5cc9c_2779x2779.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2019-10-11T12:34:30.000Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!29HK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18024e3c-ae9d-486b-a760-12881301b9fc_497x960.jpeg&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.peternaf.com/p/implicit-decoder-part-1-3d-reconstruction&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:173411815,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;Peter&#8217;s Substack&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!bgK2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7342014e-5a1f-4978-89ba-11439da362dd_144x144.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;cf5dfc1e-dacd-470e-86ff-abe248b8165b&quot;,&quot;caption&quot;:&quot;Intro After Implicit-Decoder part 1 &#8211; 3D reconstruction this time talking about 3D generation and limitations for deep learning and 3D.&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Implicit-Decoder part 2 &#8211; 3D generation&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:57204161,&quot;name&quot;:&quot;Peter Naftaliev&quot;,&quot;bio&quot;:&quot;Software engineer, entrepreneur | \&quot;The sculpture is already complete within the marble block, before I start my work. It is already there, I just have to chisel away the superfluous material.\&quot; Michelangelo [not the turtle] &quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5b34314b-8678-4d52-a950-76a8e7d5cc9c_2779x2779.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2019-11-16T17:19:47.000Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/$s_!w7UI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa21d1c2-525b-4abe-a427-f654fa0ecd03_790x332.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.peternaf.com/p/implicit-decoder-part-2-3d-generation&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:173411811,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;Peter&#8217;s Substack&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!bgK2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7342014e-5a1f-4978-89ba-11439da362dd_144x144.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div>]]></content:encoded></item><item><title><![CDATA[Overview of Human Pose Estimation Neural Networks – HRNet + HigherHRNet, Architectures and FAQ]]></title><description><![CDATA[High Resolution Net (HRNet) is a state of the art neural network for human pose estimation &#8211; an image processing task which finds the configuration of a subject&#8217;s joints and body parts in an image.]]></description><link>https://www.peternaf.com/p/human-pose-estimation-hrnet</link><guid isPermaLink="false">https://www.peternaf.com/p/human-pose-estimation-hrnet</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Sat, 13 Jun 2020 23:06:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/youtube/w_728,c_limit/-RZW1jJzA7c" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://arxiv.org/pdf/1902.09212.pdf">High Resolution Net (HRNet)</a> is a state of the art neural network for human pose estimation &#8211; an image processing task which finds the configuration of a subject&#8217;s joints and body parts in an image. The novelty in the network is to maintain the high resolution representation of the input data and combine it in parallel with high to low resolution sub-networks, while keeping efficient computation complexity and parameters count.</p><div id="youtube2--RZW1jJzA7c" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;-RZW1jJzA7c&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/-RZW1jJzA7c?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><h3>In this post we will cover:</h3><ul><li><p><a href="#why-hrnet">Why HRNet?</a></p></li><li><p><a href="#hrnet-architecture">HRNet and Architecture</a></p></li><li><p><a href="#higherhrnet">HigherHRNet: Scale-Aware Representation Learning for Bottom-Up Human Pose Estimation</a></p></li><li><p><a href="#demo">Demo video</a></p></li><li><p><a href="#code">Code FAQ</a></p></li></ul><h2>Why HRNet?</h2><ul><li><p>Good well documented and maintained open source (<a href="https://github.com/leoxiaobin/deep-high-resolution-net.pytorch">link</a>) . 2490 stars on github &#8211; of the highest rated around all human pose estimation.</p></li><li><p>It is used as the backbone for the recent new architectures in the same research space (example in <a href="https://jingdongwang2017.github.io/Projects/HRNet/PoseEstimation.html">project</a>)</p></li><li><p>Top competitor in many pose estimation challenges (<a href="https://paperswithcode.com/paper/deep-high-resolution-representation-learning">reference</a>):</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://paperswithcode.com/sota/keypoint-detection-on-coco-test-dev" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cOr1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2cd12a-14d0-4f2e-a589-c5ecad05943f_1024x449.png 424w, https://substackcdn.com/image/fetch/$s_!cOr1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2cd12a-14d0-4f2e-a589-c5ecad05943f_1024x449.png 848w, https://substackcdn.com/image/fetch/$s_!cOr1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2cd12a-14d0-4f2e-a589-c5ecad05943f_1024x449.png 1272w, https://substackcdn.com/image/fetch/$s_!cOr1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2cd12a-14d0-4f2e-a589-c5ecad05943f_1024x449.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cOr1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2cd12a-14d0-4f2e-a589-c5ecad05943f_1024x449.png" width="1024" height="449" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc2cd12a-14d0-4f2e-a589-c5ecad05943f_1024x449.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:449,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://paperswithcode.com/sota/keypoint-detection-on-coco-test-dev&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!cOr1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2cd12a-14d0-4f2e-a589-c5ecad05943f_1024x449.png 424w, https://substackcdn.com/image/fetch/$s_!cOr1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2cd12a-14d0-4f2e-a589-c5ecad05943f_1024x449.png 848w, https://substackcdn.com/image/fetch/$s_!cOr1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2cd12a-14d0-4f2e-a589-c5ecad05943f_1024x449.png 1272w, https://substackcdn.com/image/fetch/$s_!cOr1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc2cd12a-14d0-4f2e-a589-c5ecad05943f_1024x449.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">#1 on COCO</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://paperswithcode.com/sota/pose-estimation-on-coco-test-dev" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nkjp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a8556f-f2fc-4e51-9d1d-5195a8dae15c_1154x499.png 424w, https://substackcdn.com/image/fetch/$s_!nkjp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a8556f-f2fc-4e51-9d1d-5195a8dae15c_1154x499.png 848w, https://substackcdn.com/image/fetch/$s_!nkjp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a8556f-f2fc-4e51-9d1d-5195a8dae15c_1154x499.png 1272w, https://substackcdn.com/image/fetch/$s_!nkjp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a8556f-f2fc-4e51-9d1d-5195a8dae15c_1154x499.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nkjp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a8556f-f2fc-4e51-9d1d-5195a8dae15c_1154x499.png" width="1154" height="499" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/98a8556f-f2fc-4e51-9d1d-5195a8dae15c_1154x499.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:499,&quot;width&quot;:1154,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://paperswithcode.com/sota/pose-estimation-on-coco-test-dev&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!nkjp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a8556f-f2fc-4e51-9d1d-5195a8dae15c_1154x499.png 424w, https://substackcdn.com/image/fetch/$s_!nkjp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a8556f-f2fc-4e51-9d1d-5195a8dae15c_1154x499.png 848w, https://substackcdn.com/image/fetch/$s_!nkjp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a8556f-f2fc-4e51-9d1d-5195a8dae15c_1154x499.png 1272w, https://substackcdn.com/image/fetch/$s_!nkjp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a8556f-f2fc-4e51-9d1d-5195a8dae15c_1154x499.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">#1 on COCO</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://paperswithcode.com/sota/pose-tracking-on-posetrack2017" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gQBG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f24770d-1029-4b31-8519-dd1e91424ba7_1024x448.png 424w, https://substackcdn.com/image/fetch/$s_!gQBG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f24770d-1029-4b31-8519-dd1e91424ba7_1024x448.png 848w, https://substackcdn.com/image/fetch/$s_!gQBG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f24770d-1029-4b31-8519-dd1e91424ba7_1024x448.png 1272w, https://substackcdn.com/image/fetch/$s_!gQBG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f24770d-1029-4b31-8519-dd1e91424ba7_1024x448.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gQBG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f24770d-1029-4b31-8519-dd1e91424ba7_1024x448.png" width="1024" height="448" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2f24770d-1029-4b31-8519-dd1e91424ba7_1024x448.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:448,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://paperswithcode.com/sota/pose-tracking-on-posetrack2017&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!gQBG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f24770d-1029-4b31-8519-dd1e91424ba7_1024x448.png 424w, https://substackcdn.com/image/fetch/$s_!gQBG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f24770d-1029-4b31-8519-dd1e91424ba7_1024x448.png 848w, https://substackcdn.com/image/fetch/$s_!gQBG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f24770d-1029-4b31-8519-dd1e91424ba7_1024x448.png 1272w, https://substackcdn.com/image/fetch/$s_!gQBG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f24770d-1029-4b31-8519-dd1e91424ba7_1024x448.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">#2 on PoseTrack2017</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://paperswithcode.com/sota/pose-estimation-on-mpii-human-pose" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uZoK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7b059b8-8261-487b-a09d-25930cfde641_1024x449.png 424w, https://substackcdn.com/image/fetch/$s_!uZoK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7b059b8-8261-487b-a09d-25930cfde641_1024x449.png 848w, https://substackcdn.com/image/fetch/$s_!uZoK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7b059b8-8261-487b-a09d-25930cfde641_1024x449.png 1272w, https://substackcdn.com/image/fetch/$s_!uZoK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7b059b8-8261-487b-a09d-25930cfde641_1024x449.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uZoK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7b059b8-8261-487b-a09d-25930cfde641_1024x449.png" width="1024" height="449" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e7b059b8-8261-487b-a09d-25930cfde641_1024x449.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:449,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://paperswithcode.com/sota/pose-estimation-on-mpii-human-pose&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!uZoK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7b059b8-8261-487b-a09d-25930cfde641_1024x449.png 424w, https://substackcdn.com/image/fetch/$s_!uZoK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7b059b8-8261-487b-a09d-25930cfde641_1024x449.png 848w, https://substackcdn.com/image/fetch/$s_!uZoK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7b059b8-8261-487b-a09d-25930cfde641_1024x449.png 1272w, https://substackcdn.com/image/fetch/$s_!uZoK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7b059b8-8261-487b-a09d-25930cfde641_1024x449.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">#6 on MPII</figcaption></figure></div><h2>HRNet Explained</h2><p>When tackling human pose estimation, we need to be able to detect a person in the image and estimate the configuration of his joins (or keypoints). Therefore, two possible methods exist for pose estimation:</p><h3>Top-down and bottom-up pose estimations</h3><p>The bottom-up approach first finds the keypoints and then maps them to different people in the image, while the top-down approach first uses a mechanism to detect people in an image, put a bounding box area around each person instance and then estimate keypoint configurations within the bounding boxes.</p><p>Top-down methods rely on a separate person detection network and need to estimate keypoints individually for each person, therefore they are normally computationally intensive because they are not truly end-to-end systems. By contrast, bottom-up methods start by localizing identity-free keypoints for all the persons in an input image through predicting heatmaps of different anatomical keypoints, followed by grouping them into person instances, this effectively makes them much faster.</p><p>The top-down approach is more prevalent and currently achieves better prediction accuracy because it separates both tasks to use the specific neural networks trained for each, and because the bottom-up approach suffers from problems with predicting keypoints due to variations in scale of different people in an image (that is, until HigherHRNet appeared &#8211; <a href="#higherhrnet">below</a>). This scale variation does not exist in top-down methods because all person instances are normalized to the same scale. While the bottom-up approach is considered to be faster because</p><p>HRNet uses the top-down method, the network is built for estimating keypoints based on person bounding boxes which are detected by another network (FasterRCNN) during inference\testing. During training, HRNet uses the annotated bounding boxes of the given dataset.</p><h4>Two data sets are used for training and evaluating the network</h4><ul><li><p>COCO &#8211; over 200K images and 250K person instances labeled with 17 keypoints. COCO dataset evaluation requires also evaluating the person bounding boxes, this is done using FasterRCNN network. The evaluation metric is <a href="http://cocodataset.org/#keypoints-eval">object keypoint similarity (OKS)</a> &#8211; a standard keypoint detection accuracy metric.</p></li><li><p>The MPII Human Pose &#8211; around 25K images with 40K subjects. MPII evaluation is done with the annotated bounding boxes from the dataset.</p></li></ul><h3>Architecture</h3><p>Following is the diagram of the neural network, based on the code in the <a href="https://github.com/leoxiaobin/deep-high-resolution-net.pytorch">git project</a>, after which is the diagram of the network as depicted in the research paper.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3nTy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67d5eec4-a418-4a5b-bf1c-222433ab93e4_2644x3588.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3nTy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67d5eec4-a418-4a5b-bf1c-222433ab93e4_2644x3588.png 424w, https://substackcdn.com/image/fetch/$s_!3nTy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67d5eec4-a418-4a5b-bf1c-222433ab93e4_2644x3588.png 848w, https://substackcdn.com/image/fetch/$s_!3nTy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67d5eec4-a418-4a5b-bf1c-222433ab93e4_2644x3588.png 1272w, https://substackcdn.com/image/fetch/$s_!3nTy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67d5eec4-a418-4a5b-bf1c-222433ab93e4_2644x3588.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3nTy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67d5eec4-a418-4a5b-bf1c-222433ab93e4_2644x3588.png" width="2644" height="3588" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/67d5eec4-a418-4a5b-bf1c-222433ab93e4_2644x3588.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3588,&quot;width&quot;:2644,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!3nTy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67d5eec4-a418-4a5b-bf1c-222433ab93e4_2644x3588.png 424w, https://substackcdn.com/image/fetch/$s_!3nTy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67d5eec4-a418-4a5b-bf1c-222433ab93e4_2644x3588.png 848w, https://substackcdn.com/image/fetch/$s_!3nTy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67d5eec4-a418-4a5b-bf1c-222433ab93e4_2644x3588.png 1272w, https://substackcdn.com/image/fetch/$s_!3nTy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67d5eec4-a418-4a5b-bf1c-222433ab93e4_2644x3588.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">HRNet Network Architecture based on the published open-source</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JiV-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17f53643-c798-43bd-8870-b6d2075b2fb5_1147x554.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JiV-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17f53643-c798-43bd-8870-b6d2075b2fb5_1147x554.png 424w, https://substackcdn.com/image/fetch/$s_!JiV-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17f53643-c798-43bd-8870-b6d2075b2fb5_1147x554.png 848w, https://substackcdn.com/image/fetch/$s_!JiV-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17f53643-c798-43bd-8870-b6d2075b2fb5_1147x554.png 1272w, https://substackcdn.com/image/fetch/$s_!JiV-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17f53643-c798-43bd-8870-b6d2075b2fb5_1147x554.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JiV-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17f53643-c798-43bd-8870-b6d2075b2fb5_1147x554.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/17f53643-c798-43bd-8870-b6d2075b2fb5_1147x554.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!JiV-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17f53643-c798-43bd-8870-b6d2075b2fb5_1147x554.png 424w, https://substackcdn.com/image/fetch/$s_!JiV-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17f53643-c798-43bd-8870-b6d2075b2fb5_1147x554.png 848w, https://substackcdn.com/image/fetch/$s_!JiV-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17f53643-c798-43bd-8870-b6d2075b2fb5_1147x554.png 1272w, https://substackcdn.com/image/fetch/$s_!JiV-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17f53643-c798-43bd-8870-b6d2075b2fb5_1147x554.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">HRNet Network Architecture as presented in the paper</figcaption></figure></div><p>The important structure to notice is that the network calculates the high resolution sub-network (Branch 1) in parallel with lower resolution sub-networks (Branch 2-4). The sub-networks are fused through the fuse layers such that each of the high-to-low resolution representations receives information from other parallel representations over and over, leading to rich high resolution representations.</p><p>Input image is either 256 x 192 or 384 x 288 with corresponding heatmap output size of 64 x 48 or 96 x 72. The first two convolutions diminish the input size according to the expected heatmap size. The network outputs the heatmap size and 17 channels &#8211; value per each pixel in the heatmap per each keypoint (17 keypoints).</p><p>The open source architecture depicted is for 32 channel configuration. For 48 channels change every layer starting from first transition layer and forward to 48 and it&#8217;s different multiplications by 2.</p><p>Exchange block in the paper is a module in the open source, and exchange unit is the fuse layer in the open source. In the paper diagram the transition layer looks like an independent fusion of the sub-networks, while in the code, when creating a lower resolutions (higher channel) sub-network &#8211; the transition leading to it is based on the fusion leading to the previous lowest resolution sub-network with another convolution layer. Also, in the open source the fusion of the last layer is only calculated for the high resolution branch (branch 1) and not for all the branches as seen in the paper diagram.</p><p>Down-sampling, which is the stride=2 convolutions transferring from high resolution branches to lower resolution branches at the fusion part (or exchange unit), for double and triple down-sampling only enlarges the number of channels only in the last down-sample. This is either a mistake in the code or not explicitly explained in the paper. Most probably mistake in code, since information is not mapped from the larger resolution in deeper channels for the first down-samples &#8211; <a href="https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/187">Open issue in git</a>.</p><p><em>If in doubt, use the diagram which is based on the open source &#8211; this is the one used when running the trained network.</em></p><h4>Network training</h4><ul><li><p>For weights initializing the authors trained the same network, with a different output layer on the ImageNet classification dataset and used the weight values as the initialization values for pose estimation training.</p></li><li><p>Training 210 epochs of HRNet-W32 on COCO dataset takes about about 50-60 hours with 4 P100 GPUs &#8211; <a href="https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/3">reference</a>.</p></li></ul><h2><a href="https://arxiv.org/abs/1908.10357">HigherHRNet: Scale-Aware Representation Learning for Bottom-Up Human Pose Estimation</a></h2><p>This is the same research team&#8217;s new network for bottom-up pose tracking using HRNet as the backbone. The authors tackled the problem of scale variation in bottom-up pose estimation (<a href="#top-bottom">stated above</a>) and state they were able to solve it by outputting multi-resolution heatmaps and using the high resolution representation HRNet provides.</p><p>HigherHRNet outperforms all other bottom-up methods on the COCO dataset with especially large gains for medium persons. HigherHRNet also achieves state-of-the-art results on the CrowdPose dataset. The authors state that this suggests bottom-up methods are more robust to the crowded scene over top-down methods, yet there was no comparison to the regular top-down HRNet results on the same dataset.</p><p>The backbone for this network is the regular HRNet, but with an added part to the end for outputting higher resolution heatmaps:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B97j!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16c51d72-3f93-4f00-a54d-e803fe3e906f_1332x698.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B97j!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16c51d72-3f93-4f00-a54d-e803fe3e906f_1332x698.png 424w, https://substackcdn.com/image/fetch/$s_!B97j!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16c51d72-3f93-4f00-a54d-e803fe3e906f_1332x698.png 848w, https://substackcdn.com/image/fetch/$s_!B97j!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16c51d72-3f93-4f00-a54d-e803fe3e906f_1332x698.png 1272w, https://substackcdn.com/image/fetch/$s_!B97j!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16c51d72-3f93-4f00-a54d-e803fe3e906f_1332x698.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B97j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16c51d72-3f93-4f00-a54d-e803fe3e906f_1332x698.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/16c51d72-3f93-4f00-a54d-e803fe3e906f_1332x698.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Illustrating the architecture of the proposed Higher-HRNet&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Illustrating the architecture of the proposed Higher-HRNet" title="Illustrating the architecture of the proposed Higher-HRNet" srcset="https://substackcdn.com/image/fetch/$s_!B97j!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16c51d72-3f93-4f00-a54d-e803fe3e906f_1332x698.png 424w, https://substackcdn.com/image/fetch/$s_!B97j!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16c51d72-3f93-4f00-a54d-e803fe3e906f_1332x698.png 848w, https://substackcdn.com/image/fetch/$s_!B97j!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16c51d72-3f93-4f00-a54d-e803fe3e906f_1332x698.png 1272w, https://substackcdn.com/image/fetch/$s_!B97j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16c51d72-3f93-4f00-a54d-e803fe3e906f_1332x698.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The right part of the architecture outputs two heatmap &#8211; one for low resolution and one for high &#8211; the resolution are 128 x 128 and 256 x 256. During inference both heatmaps are mean aggregated to the higher resolution and the highest valued points are chosen for keypoint detection. The trapezoid is a deconvolution layer which outputs a 2 times higher resolution with 4 residual blocks following. Also, for each keypoint an output scalar tag is calculated, close tag values form a group of keypoints which belongs to a specific person and distant tags values indicate belonging to keypoint groups of different persons. The tags are calculated according to the &#8220;Associative Embedding&#8221; method described in <a href="https://arxiv.org/abs/1611.05424">this paper</a>. The tag values are only trained and predicted for the lowest resolution heatmap because the authors found that empirically higher resolution heatmaps tag values do not learn to predict well and even do not converge.</p><p>During training, the loss function is a weighted average of the heatmap prediction loss and the tag values loss (according to the associative embedding method small distance between tags of the same group leads to lower loss and so does higher distance between tags of different groups). Each heatmap resolution loss is calculated independently according to the ground truth and they are sum-aggregated.</p><p>Checking the <a href="https://github.com/HRNet/HigherHRNet-Human-Pose-Estimation">open source code</a> of HigherHRNet there is no inference code available yet to create demo pose estimation videos based on the trained network.</p><h2>Demo</h2><p>The demo video is based on the inference script in HRNet (this is an altered script that draws sticks between joins and doesn&#8217;t open pop images while running &#8211; <a href="https://drive.google.com/drive/folders/1KR462gnw05sB0nN9sicR8evyrsy1zwKs?usp=sharing">script link</a>). Credit to <a href="https://www.youtube.com/watch?v=DI211vz6SUw&amp;t=1s">Ross Smith&#8217;s Youtube channel</a>.</p><h3>Video characteristics</h3><ul><li><p>1920X1080 pixels, 25 frames per second, 56 seconds (1400 frames).</p></li><li><p>Good examples of multi person, challenging scene &#8211; both homogeneous and heterogeneous background, changing background, different camera angles including zoom in and zoom out, and a dwarf in awesome poses.</p></li></ul><h3>Runtime information</h3><ul><li><p>FasterRCNN with Resnet50 is used for person detection</p></li><li><p>HRNet with 48 channels and 384 x 288 resolution input image used.</p></li><li><p>Dell Laptop Core i5-7200, 32GB RAM, GeForce 940MX, Ubuntu 18.04 used. GPU reached 100% utilization during inference.</p></li><li><p>Average time to track all bounding boxes in a frame: 1.14 sec</p></li><li><p>Average time for all pose estimations in a frame: 0.43 sec</p></li><li><p>Average total time for one frame parsing: 1.62 sec</p></li><li><p>Total time for code to run inference over entire video: 2586.09 sec</p></li></ul><h3>Issues in the demo</h3><p>When evaluating the results of an image processing algorithm, it is important to note where the algorithm did not perform well, this gives clues into its&#8217; inherent issues:</p><ol><li><p>Shirtless people with wooden backgroud are not detected well in FasterRCNN &#8211; this might be a training data issue for the FasterRCNN network, not enough shirtless samples or not enough samples with background color similar to person color</p></li><li><p>Big yellow trampoline detected as person (minutes 00:11) &#8211; this might show and inherent problem of FasterRCNN with homogeneous scenes.</p></li><li><p>17 Keypoints detected in bounding boxes even if there is no person inside the box or not all the joints are showing &#8211; HRNet is built in a way that all 17 joints must be predicted, even if they are not visual.</p></li><li><p>It is worth noting that there is nice pose estimation even with obscuration &#8211; in the beginning of the video. Handling missing information in the image due to obscuration is tricky and HRNet is able to tackle this well.</p></li><li><p>Also worth mentioning that the stick the dwarf holds is not estimated as one of the limbs, which is also a positive sign.</p></li></ol><h2>Code FAQ</h2><ol><li><p>Pose tracking is done in RGB (<a href="https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/41">https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/41</a>) while person detection baseline trained network is done in BGR (<a href="https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/15">https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/15</a>)</p></li><li><p>Working with the coco dataset API pycocotools is not compatible with python 3 <a href="https://github.com/cocodataset/cocoapi/issues/49">https://github.com/cocodataset/cocoapi/issues/49</a> . HRNet mostly works, but once you started playing around with pycocotools, there might be exceptions.</p></li><li><p>Have to use numpy 1.17: <a href="https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/177">https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/177</a></p></li><li><p>How to use your own dataset to train the network: <a href="https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/68">https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/68</a></p></li><li><p>In inference consider using model.no_grad to speed up performance and lower mem usage (I haven&#8217;t tested it)</p></li><li><p>Third joint parameter seems to always be zero and for the joints_3d_vis object first two parameters always have the same viability flag, while the third is also zero, from coco.py -&gt;_load_coco_keypoint_annotation_kernal(). Joints are of size 3 as a preparation for affine transform in JoinsDataset -&gt; <strong>getitem</strong>() -&gt; affine_transform, but the third parameter is never used (maybe it is legacy, or, it was put in place for later use for HigherHRNet). Same thing seems to happen for MPII dataset.</p></li><li><p>During validation\test there is no use of the annotated joints (even though they are saved in the dataloader pipeline) &#8211; the accuracy results printed during the test run are not correct because of it. The entire pipeline of accuracy calculation during the test run is redundant. In the end of the run they use the coco api to calculate the right accuracy measures</p></li><li><p>Inference is configured with 384X288 (but the Readme says to use 256X192)</p></li></ol><h4>Image and joints transforms</h4><ul><li><p>demo/inference &#8211; box_to_center_scale() scales the image according to the boxes, but it is not clear what pixel_std=200 does. There are several open issues about it:<br><a href="https://github.com/microsoft/human-pose-estimation.pytorch/issues/26">https://github.com/microsoft/human-pose-estimation.pytorch/issues/26</a><br><a href="https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/23">https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/23</a><br><a href="https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/9">https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/9</a><br><a href="https://github.com/microsoft/human-pose-estimation.pytorch/issues/94">https://github.com/microsoft/human-pose-estimation.pytorch/issues/94</a> &#8211; &#8220;<em>I think It is just a hyper parameter representing the default w/h of the bounding box. Just leave it alone.</em>&#8220;</p></li><li><p>center and scale are according to position of detected annotated bbox within the original image. Center is the center of the bbox on the original image and scale should be the size of the bbox relative to the riginal image &#8211; from coco.py-&gt;_load_coco_person_detection_results(). the bbox is constructed from x, y, w, h = box[:4] (x,y,width,height). When calculating scale, aspect ratio and normalization based on pre-configured pixel_std and 1.25 scale is done.</p></li><li><p>inference -&gt; get_pose_estimation_prediction returns coords on the original image (there is no rotation, just center and scale of each bounding box )</p></li><li><p>JointsDataset-&gt;getitem-&gt;get_affine_transform gets a transformation which enlarges the scale of the original image according to how larger it is than the bbox and then centers the image in the center of the bbox.</p></li><li><p>Then, warpAffine transfers the original image to be in the center and the scale provided, meaning we should see the area of the bbox in the output image. The output image is cropped, its&#8217; 0,0 point correspond to the point on the original image which after transfer lands on the 0,0 coordinate, the cropping is done moving right and down from that point.</p></li><li><p>During training the affine transform also has random rotation scaling and flipping class JointsDataset &#8211; &gt; __getitem__()</p></li><li><p>Objects in self.db in JointsDataset are changed by reference. self.db is populated in line 246 of class COCODataset -&gt; _load_coco_person_detection_results().</p></li><li><p>The transformation calculation is: x_new(of x_old),y_new(of y_old),z = T*(x_old,y_old,1)<br>Good place to see the example: <a href="https://docs.opencv.org/master/dd/d52/tutorial_js_geometric_transformations.html">https://docs.opencv.org/master/dd/d52/tutorial_js_geometric_transformations.html</a></p></li><li><p>Joints positions can be negative after transform &#8211; they are transferred with the same transformation matrix as the image,and since there is transformation towards the center and enlarging scale according to the bounding box, some joints can be outside the box.</p></li><li><p>Center and scale annotations for MPII are not completely clear &#8211; <a href="https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/51">https://github.com/leoxiaobin/deep-high-resolution-net.pytorch/issues/51</a></p></li></ul>]]></content:encoded></item><item><title><![CDATA[Machine Learning project management – A decision makers’ guide]]></title><description><![CDATA[Working on many machine learning (ML) projects for many different clients, and discussing the nature of ML project management with other peers and ML specialists we recognized there is sometimes a gap between the expectations of the decision makers who are interested in implementing ML in their business and what can actually be done, at what time range and how much effort and cost it might take.]]></description><link>https://www.peternaf.com/p/machine-learning-project-management-a-decision-makers-guide</link><guid isPermaLink="false">https://www.peternaf.com/p/machine-learning-project-management-a-decision-makers-guide</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Mon, 13 Apr 2020 12:32:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!uMPm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc40d9753-f466-4bc3-aaa9-424e72c49ca2_1024x671.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Working on many machine learning (ML) projects for many different clients, and discussing the nature of ML project management with other peers and ML specialists we recognized there is sometimes a gap between the expectations of the decision makers who are interested in implementing ML in their business and what can actually be done, at what time range and how much effort and cost it might take. So, we decided to write this guide for managers, CEOs, VP Products, business analysts, startup founders, and, in general anyone who is thinking of hiring in-house or outside help to develop ML algorithms to solve a problem.</p><p><em>In this guide you will learn:</em></p><ul><li><p>What to expect when embarking on a machine learning project in your company?</p></li><li><p>What you should be wary of?</p></li><li><p>Where are the opportunities using machine learning?</p></li><li><p>What efforts will be required on your team&#8217;s part to make it succeed?</p></li><li><p>How much is a machine learning project going to cost you?</p></li><li><p>How to recognize good ML engineers?</p></li></ul><h1>Some definitions which we will require</h1><ul><li><p>Forms of machine learning &#8211; The industry trends these days define several different forms of machine learning:</p><ul><li><p>Deep learning, or, neural network &#8211; a form in which a computer is programmed to run in a similar fashion to neuron cells in a biological brain. There is a network of computer programmed neurons connected to each other, created a graph, on one end the network receives an input and on the other end emits an output</p></li></ul><ul><li><p>Statistical analysis &#8211; These are the old school techniques, for example &#8211; regression or anova analysis. Today, in the industry, they are usually considered part of ML.</p></li></ul><ul><li><p>Machine learning refers many times to more sophisticated methods of statistical analysis, methods such as SVM, decision trees, clustering algorithms and more. You do not need to know these specific keywords in order to understand the rest of this guide</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!l2zZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cbbc4aa-2dd0-4791-8b73-cdfea436fd15_72x72.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!l2zZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cbbc4aa-2dd0-4791-8b73-cdfea436fd15_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!l2zZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cbbc4aa-2dd0-4791-8b73-cdfea436fd15_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!l2zZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cbbc4aa-2dd0-4791-8b73-cdfea436fd15_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!l2zZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cbbc4aa-2dd0-4791-8b73-cdfea436fd15_72x72.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!l2zZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cbbc4aa-2dd0-4791-8b73-cdfea436fd15_72x72.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6cbbc4aa-2dd0-4791-8b73-cdfea436fd15_72x72.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&#128522;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="&#128522;" title="&#128522;" srcset="https://substackcdn.com/image/fetch/$s_!l2zZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cbbc4aa-2dd0-4791-8b73-cdfea436fd15_72x72.png 424w, https://substackcdn.com/image/fetch/$s_!l2zZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cbbc4aa-2dd0-4791-8b73-cdfea436fd15_72x72.png 848w, https://substackcdn.com/image/fetch/$s_!l2zZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cbbc4aa-2dd0-4791-8b73-cdfea436fd15_72x72.png 1272w, https://substackcdn.com/image/fetch/$s_!l2zZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cbbc4aa-2dd0-4791-8b73-cdfea436fd15_72x72.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div></li></ul></li><li><p>Feature &#8211; Single data point of a sample, or, in other words a specific characteristic of a data sample. Examples:</p><ul><li><p>Size of an object &#8211; Width in meter^2, height in centimeter, etc..</p></li></ul><ul><li><p>Categorical measure of an object &#8211; Male\Female, Car\Bus\Bike\Truck, etc..</p></li></ul><ul><li><p>Price, for example price of a sale in dollars.</p></li></ul><ul><li><p>The color value of one pixel (0,0,0) &#8211; RGB with 3 features</p></li></ul><ul><li><p>Signal measure in 1 time point &#8211; Amplitude of sound signal (1db), etc..</p></li></ul></li></ul><h1>Technical considerations</h1><h2>The TL/DR version</h2><ul><li><p>Rule of thumb &#8211; if a human looking at data and can&#8217;t recognize a pattern, ML probably won&#8217;t also</p></li><li><p>Two type of algorithms &#8211; requires training or pre-trained</p></li><li><p>Unsupervised or anomaly detection algorithms rarely work, unless you have very clean data</p></li><li><p>On the other hand, there are simple implementations for group separation for labeled groups</p></li><li><p>The more training data the better, the minimal amount of data varies with project requirements and algorithms implemented</p></li><li><p>Data formatting, examination and transformation is roughly 70% of the work</p></li><li><p>Deep learning won&#8217;t solve your problems, unless maybe if you do vision\signal processing</p></li><li><p>Killer feature is more important than the algorithm</p></li></ul><h2>Rule of thumb &#8211; if a human looking at data and can&#8217;t recognize a pattern, ML probably won&#8217;t also</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!O11f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba811987-cf92-43bd-8fd4-34c9a99aa070_749x536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!O11f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba811987-cf92-43bd-8fd4-34c9a99aa070_749x536.png 424w, https://substackcdn.com/image/fetch/$s_!O11f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba811987-cf92-43bd-8fd4-34c9a99aa070_749x536.png 848w, https://substackcdn.com/image/fetch/$s_!O11f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba811987-cf92-43bd-8fd4-34c9a99aa070_749x536.png 1272w, https://substackcdn.com/image/fetch/$s_!O11f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba811987-cf92-43bd-8fd4-34c9a99aa070_749x536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!O11f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba811987-cf92-43bd-8fd4-34c9a99aa070_749x536.png" width="375" height="268" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ba811987-cf92-43bd-8fd4-34c9a99aa070_749x536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:268,&quot;width&quot;:375,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!O11f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba811987-cf92-43bd-8fd4-34c9a99aa070_749x536.png 424w, https://substackcdn.com/image/fetch/$s_!O11f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba811987-cf92-43bd-8fd4-34c9a99aa070_749x536.png 848w, https://substackcdn.com/image/fetch/$s_!O11f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba811987-cf92-43bd-8fd4-34c9a99aa070_749x536.png 1272w, https://substackcdn.com/image/fetch/$s_!O11f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba811987-cf92-43bd-8fd4-34c9a99aa070_749x536.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Before running a machine learning algorithm, it helps if you can visualize the data, see repeating patterns with your own eyes. This could be in the form of graphs, showing a clearly visible trend line, such as on the right.</p><p>Some of our clients sometimes develop and in-house rule-based decision machine. For example, if a customer bought a dining table, they would recognize he might also be interested in a chair and put in a rule in the software to offer chairs to customers buying tables. This is good, this means there are indeed repeating patterns in the data.</p><p>Machine learning could help you find more patterns you have missed. Or, refine pattern definitions you found, making the pattern recognition more accurate and more actionable for you.</p><h2>Train or use pre-trained algorithm</h2><p>ML is known for training periods of the algorithm &#8211; You supply your own data, or some other existing dataset and you <em><strong>train the algorithm</strong></em> to recognize patterns in the data you are interested in. Sometimes people use the phrases &#8220;supervised&#8221; and &#8220;non-supervised&#8221;:</p><p><em>Supervised</em> means that your training data is classified to different groups. For example, if you develop an algorithm to recognize between photos and cats and dogs, in the supervised method, you will have photos of cats, labeled as cats, and images of dogs, labeled as dogs, and you will train an ML algorithm to recognize cats and dogs based on this training data.</p><p><em>Unsupervised</em> means you have training data, but it is not classified. In the cats and dogs example, you will have photos of cats and dogs but no labeling of which is cat and which is dog. You only know there are 2 possibilities for the label of the photo. In this case, you will train the algorithm to distinguish two groups in your training data.</p><p>Notice, both supervised and unsupervised methods require training an algorithm.</p><p>The second option is using a <em><strong>pre-trained algorithm</strong></em>, or an algorithm that does not require training. These are pre-prepared algorithms, ready to use. For example, there are already existing algorithms for image recognition, which were trained using huge academia datasets to recognize between different objects in an image. Another example, albeit not exactly machine learning, but an AI method, is textual index and search software. These programs come prepared with the ability to analyze text in different languages, without requiring you to supply training text samples.</p><p>The pre-trained approach is more generic and could be implemented in every company quite easily. The issues with this approach are:</p><ol><li><p>Licensing &#8211; sometimes you are unable to use a pre-trained algorithm, because it was trained using proprietary data that have license limitations for usage.</p></li><li><p>The prediction\estimation\classification quality of the algorithm on your data might be worse, because the algorithm was not trained on your data.</p></li><li><p>Pre-trained algorithms exist only for a specific set of problems and specific constructs of data, many times you might not be able to find a pre-trained algorithm which complies to your exact needs. In contrast, training your own algorithm is very generic and can be used for any required data analysis question.</p></li></ol><p>It is always best to train the algorithm using your own specific and custom data. But, many times, companies don&#8217;t have enough data for training, so they are forced to use pre-trained algorithms.</p><p>It is worth mentioning, if an implementation of an algorithm worked for another company or in another research, doing the same for your company might require a completely different project, it all depends on the dataset you have.</p><h2>Unsupervised or anomaly detection algorithms rarely work, unless you have very clean data</h2><p>These methods are sort of &#8217;machine learning magic&#8217; and should be treated as such. Trying to take a bunch of data and put into an algorithm hoping something good will come out, is, as expected, unique.</p><p><em><strong>Unsupervised learning</strong></em> can work if there is a true different between the different groups we are trying to identify, and this difference clearly shows in the features (Refer to the rule of thumb above about human looking at data). Also, usually we have to know in advance how many different groups we are expected to encounter in the data.</p><p>An interesting example of clustering images of handwritten digits to different groups in an unsupervised manner can be seen here:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uMPm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc40d9753-f466-4bc3-aaa9-424e72c49ca2_1024x671.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uMPm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc40d9753-f466-4bc3-aaa9-424e72c49ca2_1024x671.png 424w, https://substackcdn.com/image/fetch/$s_!uMPm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc40d9753-f466-4bc3-aaa9-424e72c49ca2_1024x671.png 848w, https://substackcdn.com/image/fetch/$s_!uMPm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc40d9753-f466-4bc3-aaa9-424e72c49ca2_1024x671.png 1272w, https://substackcdn.com/image/fetch/$s_!uMPm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc40d9753-f466-4bc3-aaa9-424e72c49ca2_1024x671.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uMPm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc40d9753-f466-4bc3-aaa9-424e72c49ca2_1024x671.png" width="1024" height="671" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c40d9753-f466-4bc3-aaa9-424e72c49ca2_1024x671.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:671,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!uMPm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc40d9753-f466-4bc3-aaa9-424e72c49ca2_1024x671.png 424w, https://substackcdn.com/image/fetch/$s_!uMPm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc40d9753-f466-4bc3-aaa9-424e72c49ca2_1024x671.png 848w, https://substackcdn.com/image/fetch/$s_!uMPm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc40d9753-f466-4bc3-aaa9-424e72c49ca2_1024x671.png 1272w, https://substackcdn.com/image/fetch/$s_!uMPm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc40d9753-f466-4bc3-aaa9-424e72c49ca2_1024x671.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Taken from this <a href="http://projector.tensorflow.org/">tensorflow link</a></p><p><em><strong>Anomaly detection</strong></em> could work, if there are enough samples of the unique occasions we are trying to identify, and these samples are indeed much more different than the standard (non-anomalous) situation.</p><h2>On the other hand, there are simple implementations for group separation for labeled groups</h2><p>Sometimes it could be quite easy to have samples from different groups and train a machine learning algorithm to recognize a new sample from an unknown group. For example, in psychological behavior studies these techniques have been used by statisticians for many years in order to recognize correlations between different behaviors, combinations of behaviors and group belonging.</p><h2>How much data will you require for training?</h2><p>More is always better in this case. Still, to be more concrete, it really changes with the problem you are trying to solve. This is usually one of the parts of the algorithm implementation &#8211; examining the specific data at hand, the specific problem to be solved and seeing what algorithms can work and how much data is required.</p><p>A common issue arises when there is a large data set, but it is not spread evenly. For example, when a company wants to recognize what features lead to more customer sales conversions, the company might have information about thousands of potential customers but only a handful of customers who bought. In this case, it might be hard if not impossible to run any type of machine learning algorithm to bring meaningful results. In another example, recognizing heavy machinery malfunctions based on sound, pressure measures, temperature or other physical measures, might be impossible if there are a handful of samples when the machine was not working right, and the rest of the samples are when the machine was working good.</p><p>Some benchmarks from our own personal experience:</p><ul><li><p>In forecasting and trend analysis, to be able to recognize a seasonal (yearly) trend, a minimum f 2 years of samples is required. This is because broadly 1 year is used for baseline estimation and another year for trend estimation.</p></li><li><p>In 3D modeling (you can check out <a href="https://medium.com/ai%C2%B3-theory-practice-business/implicit-decoder-3d-reconstruction-9c0f87e80f11">our medium post</a> as an example) &#8211; At least 5,000 3D models of a specific object are required (5,000 models of chairs)</p></li><li><p>In video analysis &#8211; When we were working on our lip-reading startup, we saw that we need a minimum of 70,000 hours video of people talking (This was about 10 terabytes of data) to get our neural network to learn anything.</p></li></ul><h2>It&#8217;s not just how much data, it is also how is it formatted</h2><p>Many times, an ML project starts off with cleaning the provided data, changing it, simplifying its&#8217; structure. In this stage a lot of bugs and issues are found in the data. There might have been an unexpected issue with how the data was originally prepared or saved, or another issue with how the data was exported. All these take time and effort and have to be done very carefully. Because, otherwise we might train an algorithm on completely incorrect information, not get any good results and blame it on the algorithm instead of the original training data.</p><p>In projects, 70% of the actual work is at this stage of data re-formatting and testing.</p><h2>Deep learning won&#8217;t solve your problems, unless maybe if you do vision\signal processing</h2><p>Sometimes clients start talking to us and they will talk about different things they saw online with deep learning and neural networks that they would like us to implement for them. Deep learning is just another type machine learning algorithm to try out. It usually takes more time and effort to construct and optimize a deep learning algorithm to solve a problem than to use something simpler, such as logistic regression or regular regression (depends on the question at hand). In most cases, it is an overkill to implement deep learning. The cases for which deep learning is a must is for technically hard situations, such as image analysis, text analysis, signal processing, biological data analysis or other types of projects in which features are complex and usually there are thousands of features per data sample.</p><h2>Killer feature is more important than the algorithm</h2><p>Many times, it is more worthwhile to work on the features, test them out, try to come up with new features. Usually if you have a good feature the simplest algorithm will be enough. For example, in the above example of a customer buying a table will also buy a chair, if you have the feature &#8211; the category of the last item sold (in our case, table), then, even a simple logistic regression model might be able to recognize that the next category sold will be chair.</p><p>This means that for an ML engineer, it is more important to very good at simple data analysis and data engineering than at knowing all the different ML algorithms and implementing them.</p><h1>Timelines, pricing and recruiting considerations</h1><p>Initial data examination takes a minimum of 1 hour for the simplest of cases to two weeks of full-time work.</p><p>Time it takes to research specific algorithms or new algorithms released from academia:</p><ol><li><p>At least 4 days to go over the most relevant research papers and information.</p></li><li><p>Between half a day to 2 weeks to implement basic open source code, if it exists.</p></li><li><p>Customizing the algorithms or training on your data might take months, depending on the complexity of the problem at hand, the quality of the training data (or, lack of it) and required KPIs.</p></li></ol><p>In some cases, such as anomaly detection, it is impossible to define actionable technical KPIs because it is never clear how accurate even the best algorithm might turn out.</p><p>Custom made projects can be expensive, prices range from 120$ to 300$ per hour work.</p><p>Usually starting off small, with quick simple wins and then progressing if you see the value in implementing machine learning is the way to go. It is advisable not to spend months developing before you see any progress. Try 1-2 months, focus on an achievable short-term goal, maybe even a simple report, with simple tools. If this works out, then advance to something more sophisticated.</p><h2>How to recognize the right ML company\consultant\hire</h2><ul><li><p>They tell you the same things written above.</p></li><li><p>They start off with showing you graphs and dashboards over your data instead of diving into developing.</p></li><li><p>They say no if they recognize the dataset is not good enough, and they give you tips on how you could still do machine learning if you are interested, what you need to focus on.</p></li><li><p>They are expensive.</p></li><li><p>They explain basic concepts in simple to understand language to help you understand the project, its&#8217; scope and its&#8217; limitations.</p></li></ul><p>If you have any questions or interest in doing a machine learning project, feel free to contact us on the section to the left of this page.</p><p>Also, we have launched <a href="https://datask.co">datask.co</a> &#8211; You ask the data, we answer. This is a machine learning as a service product for those who are interested in implementing machine learning but don&#8217;t have the time or resources to do it themselves. Be sure to check it out!</p>]]></content:encoded></item><item><title><![CDATA[Tensorflow 2 Internals – Lessons learned from creating a 50 hours course]]></title><description><![CDATA[I was asked to teach a course about a new version deep learning framework by google &#8211; Tensorflow version 2 to a company of highly technical people creating smart acoustic and microphone systems for recording studios.]]></description><link>https://www.peternaf.com/p/tensorflow-2-internals-lessons-learned-from-creating-a-50-hours-course</link><guid isPermaLink="false">https://www.peternaf.com/p/tensorflow-2-internals-lessons-learned-from-creating-a-50-hours-course</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Mon, 17 Feb 2020 08:36:20 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rIWZ!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fcc7748-5616-4c6c-9177-20671172e987_1280x1280.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I was asked to teach a course about a new version deep learning framework by google &#8211; Tensorflow version 2 to a company of highly technical people creating smart acoustic and microphone systems for recording studios. Tensorflow 2 came out during the middle of 2019 and is very different than the previous version, so there was a lot of learning to do and trial and error in the face of unknown code, api and bugs.This took me about 3 months of almost full time job to complete. After the course finished I also asked the students to fill in a review about it so I will have their input.&nbsp;During the process I learned a lot about learning, creative work and presentation. I am sharing this here both for my own sake and for anyone else who might benefit from this knowledge.</p><h2><em>How to learn new material</em></h2><ol><li><p>Map information sources</p><ol><li><p>Go online and filter and map all quality sources of material. When the subject is quite new, there are not so many quality information sources online. Doing a first map of all the good quality sources you found gives access to information and at the same time confidence that you are not going to miss out on information because you didn&#8217;t know of another source. For example these sources can be:</p><ol><li><p>Youtube videos</p></li><li><p>Official documentation</p></li><li><p>Open source side projects</p></li><li><p>Books</p></li><li><p>Online lectures</p></li><li><p>Conferences\events which have a written online record of what was taught</p></li><li><p>Stack overflow questions\comments</p></li></ol></li><li><p>There are sources of sources online &#8211; pages that reference to other quality information sources, a sort of dynamic online index. These can be reddit posts, youtube lectures with references (by the google tensorflow team in my case), good github pages and more. Go over all of them and map the most relevant and good information sources you will use.</p></li><li><p>Also possible to ask friends for reference materials &#8211; in my case, the subject was so new, almost non of my tech friends could help</p></li><li><p>While you do this first initial mapping, you will inevitably encounter the most significant topics of to learn (and teach), start writing down recurring topic names\chapter or topics which you saw might be extra interesting or relevant even though they are not the main topics.</p></li><li><p>You will also encounter knowledgeable people or specific quality sources, check all their content, you might find more missing gems there.&nbsp;</p></li><li><p>Mark specific references which you might use in whole or part while teaching &#8211; either as teaching material or exercise material.</p></li><li><p>In my tensorflow learning I found these resources to be extremely helpful</p><ol><li><p>Google TensorFlow guides and tutorials</p></li><li><p>Everything by&nbsp;Aur&#233;lien G&#233;ron<a href="https://github.com/ageron/tf2_course">https://github.com/ageron/tf2_course</a>His book:&nbsp;<a href="https://learning.oreilly.com/library/view/hands-on-machine-learning/9781492032632/">https://learning.oreilly.com/library/view/hands-on-machine-learning/9781492032632/</a></p></li><li><p>Stanford class&nbsp;<a href="https://web.stanford.edu/class/cs20si/">https://web.stanford.edu/class/cs20si/</a></p></li><li><p>Tensorflow Youtube channel, especially with the &#8220;Inside Tensorflow&#8221; playlist &#8211;&nbsp;<a href="https://www.youtube.com/watch?v=yTJ8QydIgVQ&amp;list=PLQY2H8rRoyvzIuB8rZXs7pfyjiSUs8Vza">https://www.youtube.com/watch?v=yTJ8QydIgVQ&amp;list=PLQY2H8rRoyvzIuB8rZXs7pfyjiSUs8Vza</a>&nbsp;and videos from TF conferences.</p></li><li><p>These reddit posts</p><ol><li><p><a href="https://www.reddit.com/r/MachineLearning/comments/7u1hki/d_recommendations_for_tutorials_on_tensorflow/">https://www.reddit.com/r/MachineLearning/comments/7u1hki/d_recommendations_for_tutorials_on_tensorflow/</a></p></li><li><p><a href="https://www.reddit.com/r/tensorflow/comments/bliecp/best_way_to_learn_tensorflow_20/">https://www.reddit.com/r/tensorflow/comments/bliecp/best_way_to_learn_tensorflow_20/</a></p></li></ol></li><li><p>This github page with a huge amount of resources and references&nbsp;<a href="https://github.com/Amin-Tgz/Awesome-TensorFlow-2/blob/master/README.md">https://github.com/Amin-Tgz/Awesome-TensorFlow-2/blob/master/README.md</a></p></li></ol></li></ol></li><li><p>Filtering</p><ol><li><p>Briefly check each information source to see if it is good or just someone posting content more for self promotion\marketing and less for giving real value and insight info about a topic</p></li><li><p>make sure you only have the best reference for each sub-topic, If a subtopic has more than 3 information sources, save all of them, use only the best\main 3 and if you need extra info then you have where to look.</p></li><li><p>While you are filtering you will start to learn the basic concepts of what you are learning, you will start to get a feel for what you should focus more on later, what is extra interesting.</p></li><li><p>Going over tensorflow materials I found that a lot of the materials might say they are for tensorflow 2, but actually they are for tensorflow 1. Also, a lot of the materials were brief and shallow explanations without real proper content and value. This filtering step took me about two days to finish.<br></p></li></ol></li><li><p>First reading</p><ol><li><p>White papers\Architecture reviews &#8211; read thoroughly. I started off my tensorflow learning process by reading the google whitepaper from 2015 for the framework. Interestingly, I also finished learning tensorflow with this white paper, after I went over all the other material and presentations. When I started learning the white paper helped me understand which important/interesting/complicated topics I will encounter and what I should teach. I ended with the white paper because it had in depth explanation about the specifics of the framework which were hard to find in other places.</p></li><li><p>Official documentation &#8211; skim. The purpose is:</p><ol><li><p>Check what will be hard and tricky to learn (which means it will consume a lot of time and effort) and what will be easy</p></li><li><p>Check what are the most important things you should focus on first, what are the basics of the main subject which all other sub topics depend on</p></li></ol></li><li><p>Do at least one significant, non trivial tutorial, to start &#8220;feeling&#8221; the topic better and raising more questions.<br></p></li></ol></li><li><p>In-depth reading</p><ol><li><p>Once you have listed in order the important things to focus one, start going over them one by one, using the references which you found.</p></li><li><p>This stage can be unexpectedly long and hard, but it is important for your overall familiarity of what you are learning and for your confidence in what you learned. Do not skip and\or rush it.</p></li><li><p>Write down short summaries and the most significant sub-topics you encounter, along with links to the reference materials where you learned of these sub-topics. This will be the basis of what you will be teaching later.</p></li><li><p>If you find a specific sub-topic is taking you longer then expected. Or, maybe the sources you find don&#8217;t cover it well. This is a good sign. It means you have found an area where you can learn something new not many people online know and you can teach it later.</p><ol><li><p>If it is an immediately important sub-topic &#8211;&nbsp; Focus on it, understand it, if required read the open source until you familiarize yourself with the topic. Take notes during your learning, this will be your source of information (and your audience&#8217;s).</p></li><li><p>If this is not immediately important &#8211; write this subtopic down in your open items and make sure you have a task to come back and research this subtopic later</p></li></ol></li><li><p>While you are learning, you will encounter questions and things you don&#8217;t understand. If it is part of your learning flow, go ahead and explore them. If not, write the open questions you have in your notes and continue learning the main thing you set out to learn. These questions are important. Your real understanding comes from asking these questions (which means you understand what you are learning and you try to transfer it to something new that wasn&#8217;t completely explained). Also, when later you will answer these question the search for the answer and the final answer will greatly enlarge your overall understanding and confidence in your own understanding.</p></li><li><p>Check back on previously opened questions which might be related to a subtopic you are now learning, Most chances you will be able to answer it. If you see you are still stuck even after the depth reading this might be related to point 4 above, or you might need to learn another sub-topic before you could answer the question.</p></li><li><p>Practice and recall what you learned &#8211; Try out things by yourself (your own code) based on what you learned, see if they work or not. Try out special use-cases or or esoteric implementations which you thought of but are not written in your references &#8211; this will both help you remember the subject better and will raise issues you are not sure about in your knowledge. Also, this could be good class examples or exercises later.</p></li><li><p>While you are learning, if you encounter open questions people posted which you find answers to &#8211; post the answers online, it will help your own understanding, will help others and will promote you.<br></p></li></ol></li><li><p>Points 1-3 can be executed simultaneously, interleaving them until you cover all the interesting references. Point 4 needs to be handled by itself in a focused manner.</p></li><li><p>Summarize, log or write down things you are not sure of. Later when you learn more deeply you can delete these summaries or change them according to your new found knowledge. You can mark things you are unsure of (I use triple question marks &#8211; ???). Also, writing it down allows you to think it through, understand better and remember what you learned (even if partially). Don&#8217;t be afraid to &#8220;waste&#8221; your time writing down something you might delete later.</p></li><li><p>Bugs in the framework can be very frustrating and time consuming. When a code is not working as expected, make sure it is not working first by minimizing it as much as you can and checking the documentation if it should be working. Then, search google and github to see if anyone else wrote anything about it. If there is nothing written, you will need to double check yourself to make sure it is a bug.</p></li><li><p>Most of my personal tensorflow learning was through encountering bugs when I was trying to run my own code, from having the class ask me in-depth questions and from just experimenting with different graph structures and different ways to write similar functionalities. For example, everything I was running in eager mode I tried also running in graph mode and vice versa. One of the trickiest part to learn was to try and understand what goes under the hood with tf.data (I used the Inside Tensorflow youtube video about it to great lengths &#8211; <a href="https://www.youtube.com/watch?v=kVEOCfBy9uY&amp;list=PLQY2H8rRoyvzIuB8rZXs7pfyjiSUs8Vza&amp;index=6">https://www.youtube.com/watch?v=kVEOCfBy9uY&amp;list=PLQY2H8rRoyvzIuB8rZXs7pfyjiSUs8Vza&amp;index=6</a>). One of the things that wasted a lot of my time was a bug with TF2.1 (which was released while my course was running) and TensorBoard &#8211; it wasn&#8217;t profiling GPU usage. Took me a full day to accept that this is a bug and not something wrong which I am doing and an extra 1 day (and 300$ cloud server charges) to setup a working environment with TF2.0 instead of TF2.1.</p></li></ol><h2><em>What I learned about preparing presentations for each topic</em></h2><p>The cool thing is that if the learning part was done right, this next part is straightforward. You already have most of the materials you want to talk about and present. You also have references to interesting things to show in class and you have a breakdown of the information dependencies between the different subtopics. You also already went through many presentation on the same topics so you can follow their lines if you saw the presentations your good.Along with powerpoint presentations I use jupyter notebook to run python code in class. The jupyter notebook allows to show how code runs in real time, when exceptions occur and why and also allows an interactive way of teaching in which you can challenge the class with questions about how specific code will run and see the results live.<br>Guidelines:</p><ol><li><p>Put all your summaries and reference materials infront of you in a notebook or in powerpoint</p></li><li><p>Add any other points you think are relevant for the presentation</p></li><li><p>At this stage you will see how about how long a presentation for one topic will take</p></li><li><p>Separate all the material to</p><ol><li><p>Presentation &#8211; Powerpoint\slides</p></li><li><p>Presentation &#8211; colab\jupyter notebook code</p></li><li><p>exercise</p></li><li><p>Bonus information\practice</p></li></ol></li><li><p>Fully create the presentation slides&nbsp;</p><ol><li><p>Write notes to yourself which you will use in class</p></li><li><p>Especially write notes if you are going to present something that connect to something later on in the presentation</p></li><li><p>Explain every keyword you talk about</p></li></ol></li><li><p>Fully create jupyter code notebooks</p><ol><li><p>Try to keep text to a minimum, but enough of it so that you will remember what to talk about</p></li><li><p>Make sure all dependencies are installed as part of the notebook execution flow &#8211; good both for teaching about dependencies and making sure your code will run on any machine.</p></li><li><p>Separate the topic into sections &#8211; help organize thoughts and manage time while presenting (maybe you will want to skip some sections if you run out of time)</p></li><li><p>Along with the jupyter notebook, you should have a small reference notebooks with things you should talk about in class while presenting the notebook.</p></li></ol></li><li><p>Repeat 1-6 until you feel that you covered everything for the topic you wanted</p></li><li><p>Points 1-2 should be done separately to points 3-5. Points 1-2 require imagination, abstract thinking and experimentation, if you combine it with the technical details of creating and editing the presentation you will get frustrated and won&#8217;t be able to do an effective job.</p></li><li><p>While you build your presentation you might find out you are missing knowledge about a specific sub-topic, go back to the in-depth part above and research into that topic.</p></li><li><p>Create buffer material which you will teach if there is extra time. Your original time estimates will never be completely accurate. If you run out of time you can start off the next class from where you stopped. If you finish before time, the extra buffer material will help you fill that void.</p></li></ol><h2><em>What I learned about presenting</em></h2><ol><li><p>The focus should be on having people understand what you are teaching, not in covering all the materials. It is ok (and advised) to skip\miss parts if it means people will understand what you teach better</p></li><li><p>Take pauses when presenting, laugh with the audience, tell stories. Actively think in advance what stories you will during the presentation &#8211; it both fills time, gives rest and fun</p></li><li><p>Along with regular break times, add mini breaks during your presentation. In these mini breaks your talk or show something cool which relates to the subject being taught. This both helps to refresh and interest people in what you are teaching further.For example, I showed cool research videos of the latest things in deep learning and deep fake. Later in the reviews the students said this was a cool addition to the course.</p></li><li><p>If something interests you, it will interest the audience both because it is an interesting topic and because of your personal interest and excitement</p></li><li><p>About making perfect presentation, error-less, interesting and smooth &#8211; The audience is extremely focused in trying to grasp and understand new concepts. They don&#8217;t notice the imperfections in your presentation, they notice the imperfections in their understanding of the material. Don&#8217;t worry about making it perfect, worry about making it and making it interesting for you while putting as much effort as you can in bringing the audience value.</p></li><li><p>In my course, I thought I did a poor job with explaining everything. But, the students told me that the tools I gave them will be very valuable for their work, and the code samples were very interesting for them.</p></li></ol><h2><em>About time management in face of unknown materials or task</em></h2><p>When you start working on it, there are many things you are not familiar with, many things that can suck up your time without you being prepared. some guidelines on how to manage that:</p><ol><li><p>Briefly skim the material you need to learn\present beforehand to have a rough estimate on how complicated it is. This is why the first stage of mapping your data sources when learning is so important.</p></li><li><p>If there are many tutorials and explanations about a subject you can estimate time quite accurately. The risk is covering subjects which don&#8217;t have a lot of easily accessible information &#8211; these usually consume most of the time.</p></li><li><p>It is sometimes scary or demotivating to work only to find out you have much more work than expected. To handle that, keep a very elaborate task list with priorities and always focus on the small next step, just on what&#8217;s the most important next small thing. Start gaining small wins, these will help you get the motivation to cover an unexpectedly large topic.</p></li><li><p>If you catch yourself studying deeply into a subject that might not be so important, stop. Write it down to check later and address the next subject on the list. You might find a subject is not so important only after you dive into it and find out it is raw, buggy or not the main focus of what you are studying\teaching.</p></li><li><p>Always remember, you don&#8217;t have to know all the exact details of everything. You need to know enough to get by and enough to teach your class.</p></li><li><p>If you are stuck and can&#8217;t progress, a helpful tip is to write down a question for yourself: &#8220;why am I stuck?&#8221; and answer it with atleast 5 different answers. You will find out exactly what&#8217;s blocking your path and will be able to tackle it head on and &#8220;unstuck&#8221; yourself.</p></li></ol><h2><em>Archiving and references</em></h2><ol><li><p>You should use a notebook or other method of writing and archiving for :</p><ol><li><p>Summaries of important, or at first seemingly important, subtopics and subjects with reference to where you learned it</p></li><li><p>Reference materials</p></li><li><p>Ideas to explore\Open questions</p></li><li><p>Tasks</p></li></ol></li><li><p>I used 3 evernote notes</p><ol><li><p>&#8220;resources&#8221; &#8211; All the references I found and my initial raw ideas</p></li><li><p>&#8220;tasks&#8221; &#8211; The next tasks I should handle and any open items\unclear things I want to learn</p></li><li><p>lecture &#8211; The structure of what I will present, the subtopics, main concepts, exercises and bonus references for class</p></li></ol></li></ol>]]></content:encoded></item><item><title><![CDATA[Implicit-Decoder part 2 – 3D generation]]></title><description><![CDATA[Intro After Implicit-Decoder part 1 &#8211; 3D reconstruction this time talking about 3D generation and limitations for deep learning and 3D.]]></description><link>https://www.peternaf.com/p/implicit-decoder-part-2-3d-generation</link><guid isPermaLink="false">https://www.peternaf.com/p/implicit-decoder-part-2-3d-generation</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Sat, 16 Nov 2019 17:19:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!w7UI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa21d1c2-525b-4abe-a427-f654fa0ecd03_790x332.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Intro</h2><p>After <a href="https://2d3d.ai/index.php/2019/10/11/implicit-decoder-part-1-3d-reconstruction/">Implicit-Decoder part 1 &#8211; 3D reconstruction</a> this time talking about 3D generation and limitations for deep learning and 3D.<br></p><h2>3D generation</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nqxx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20b5d362-c75e-400b-8ad2-c35c57a7ecbd_250x250.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nqxx!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20b5d362-c75e-400b-8ad2-c35c57a7ecbd_250x250.gif 424w, https://substackcdn.com/image/fetch/$s_!nqxx!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20b5d362-c75e-400b-8ad2-c35c57a7ecbd_250x250.gif 848w, https://substackcdn.com/image/fetch/$s_!nqxx!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20b5d362-c75e-400b-8ad2-c35c57a7ecbd_250x250.gif 1272w, https://substackcdn.com/image/fetch/$s_!nqxx!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20b5d362-c75e-400b-8ad2-c35c57a7ecbd_250x250.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nqxx!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20b5d362-c75e-400b-8ad2-c35c57a7ecbd_250x250.gif" width="320" height="320" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/20b5d362-c75e-400b-8ad2-c35c57a7ecbd_250x250.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:250,&quot;width&quot;:250,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;3D Airplane Generation&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="3D Airplane Generation" title="3D Airplane Generation" srcset="https://substackcdn.com/image/fetch/$s_!nqxx!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20b5d362-c75e-400b-8ad2-c35c57a7ecbd_250x250.gif 424w, https://substackcdn.com/image/fetch/$s_!nqxx!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20b5d362-c75e-400b-8ad2-c35c57a7ecbd_250x250.gif 848w, https://substackcdn.com/image/fetch/$s_!nqxx!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20b5d362-c75e-400b-8ad2-c35c57a7ecbd_250x250.gif 1272w, https://substackcdn.com/image/fetch/$s_!nqxx!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F20b5d362-c75e-400b-8ad2-c35c57a7ecbd_250x250.gif 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">3D Airplane Generation</figcaption></figure></div><p>Remember <a href="https://2d3d.ai/index.php/2019/11/11/the-deep-learning-dictionary/#What-are-generative-networks?">GANs</a>? Well, this same technique can be used to generate the airplanes you see to the left.</p><p>How does it happen? The trick is to use the same decoder network seen below. Specifically the same decoder that was trained along with the encoder. What happens is that we train a GAN network to generate a fake z-vector.</p><p>The discriminator gets as input real z-vectors from the encoder-decoder network along with fake z-vectors from the generator network. The generator network is trained to only produce new z-vectors based on a random input. Since the decoder knows to get as input a z-vector and from it reconstruct a 3D model and the generator is trained to produce z-vectors which resemble real ones, new 3D models can be reconstructed using both networks combined.</p><p>Also, we can see that the gif shows one airplane model morphing into a new one. This is done by taking the z-vectors for the first and last 3D models, let&#8217;s call these vectors z_start and z_end, then new z-vectors are calculated as a linear combination pf z_start and z_end. Specifically, a number (let&#8217;s say alpha) between 0 and 1 is picked and then a new z &#8211; z_new is calculated: z_new = (z_start*alpha + z_end*(1-alpha)). Then z_new is fed into the decoder network and the interim 3D models can be calculated.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DhZ_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc889cd78-36b9-45a5-99b9-3dd2b72aec24_716x275.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DhZ_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc889cd78-36b9-45a5-99b9-3dd2b72aec24_716x275.png 424w, https://substackcdn.com/image/fetch/$s_!DhZ_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc889cd78-36b9-45a5-99b9-3dd2b72aec24_716x275.png 848w, https://substackcdn.com/image/fetch/$s_!DhZ_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc889cd78-36b9-45a5-99b9-3dd2b72aec24_716x275.png 1272w, https://substackcdn.com/image/fetch/$s_!DhZ_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc889cd78-36b9-45a5-99b9-3dd2b72aec24_716x275.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DhZ_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc889cd78-36b9-45a5-99b9-3dd2b72aec24_716x275.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c889cd78-36b9-45a5-99b9-3dd2b72aec24_716x275.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!DhZ_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc889cd78-36b9-45a5-99b9-3dd2b72aec24_716x275.png 424w, https://substackcdn.com/image/fetch/$s_!DhZ_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc889cd78-36b9-45a5-99b9-3dd2b72aec24_716x275.png 848w, https://substackcdn.com/image/fetch/$s_!DhZ_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc889cd78-36b9-45a5-99b9-3dd2b72aec24_716x275.png 1272w, https://substackcdn.com/image/fetch/$s_!DhZ_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc889cd78-36b9-45a5-99b9-3dd2b72aec24_716x275.png 1456w" sizes="100vw"></picture><div></div></div></a><figcaption class="image-caption">Encoder-Decoder</figcaption></figure></div><p>The reason that there is such a smooth transition between the different 3D models is that the implicit-decoder network is trained to recognize underlying 3D constructs of models based on z-vector, and more specifically, models in a specific model category. Therefore, a small change in z_vector will lead to a small change of the 3D model but still keep the 3D structure of the model category, that way it is possible to continuously change the model from z_start to z_end.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!w7UI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa21d1c2-525b-4abe-a427-f654fa0ecd03_790x332.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!w7UI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa21d1c2-525b-4abe-a427-f654fa0ecd03_790x332.png 424w, https://substackcdn.com/image/fetch/$s_!w7UI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa21d1c2-525b-4abe-a427-f654fa0ecd03_790x332.png 848w, https://substackcdn.com/image/fetch/$s_!w7UI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa21d1c2-525b-4abe-a427-f654fa0ecd03_790x332.png 1272w, https://substackcdn.com/image/fetch/$s_!w7UI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa21d1c2-525b-4abe-a427-f654fa0ecd03_790x332.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!w7UI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa21d1c2-525b-4abe-a427-f654fa0ecd03_790x332.png" width="790" height="332" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa21d1c2-525b-4abe-a427-f654fa0ecd03_790x332.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:332,&quot;width&quot;:790,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!w7UI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa21d1c2-525b-4abe-a427-f654fa0ecd03_790x332.png 424w, https://substackcdn.com/image/fetch/$s_!w7UI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa21d1c2-525b-4abe-a427-f654fa0ecd03_790x332.png 848w, https://substackcdn.com/image/fetch/$s_!w7UI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa21d1c2-525b-4abe-a427-f654fa0ecd03_790x332.png 1272w, https://substackcdn.com/image/fetch/$s_!w7UI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa21d1c2-525b-4abe-a427-f654fa0ecd03_790x332.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Generating z-vectors</figcaption></figure></div><h3>Limitations of deep learning and 3D reconstruction\generation</h3><p>These results are brought here and other places make neural networks seem to be all-capable, easy to use and generalize to other scenarios, use cases and products. Sometimes this is the case, but many times it is not. In 3D generation and reconstruction there are limitations with neural networks. To name a few:</p><h4><em>Dataset limitations</em></h4><p>As we have demonstrated, the neural network requires training each time for a specific model category. There need to be enough models&nbsp;(usually minimum hundreds) in each category and enough categories to allow for any type of real life application of this type of neural network, ShapeNet are doing this work for the academic world and even there the amounts of categories and models in every category is limited. To make it commercially viable, we will need more models and categories. Also, each model needs to be labeled to its&#8217; exact category, needs to be aligned translated and scaled accurately, needs to be saved in the right format. In addition, for each model we need images from different angles, different lighting positions and camera parameters, different scales alignments and translations. Again, ShapeNet and other research initiatives help with building this in order to help scientific progress. But, this also means there is a lot of overhead in dataset creation and processing in order to make this research into a product.</p><h4><em>Accuracy Measures</em></h4><p>A recurring question is how accurate is the 3D reconstruction or generation. A response question to this is &#8211; how do you measure accuracy in 3D reconstruction? Let&#8217;s say a human 3D designer reconstructs a 3D model from an image, how can we say if his work is accurate or not? Even if we have the original 3D model, how can we say that two 3D models are similar, or that the reconstructed 3D model is similar to the origin, and how can we quantify this similarity?The old school methods, such as MSE, IoU, F1 score, Chamfer and Normal distance [[Add reference &#8211; <a href="https://2d3d.ai/index.php/2019/10/09/3d-scene-reconstruction-from-single-image/">https://2d3d.ai/index.php/2019/10/09/3d-scene-reconstruction-from-single-image/</a>]] are straightforward measures that don&#8217;t account for the 3D structure of the object. For example, IoU checks how much of the volume of a reconstructed 3D shape overlaps with the original 3D shape in comparison to the joint volume of both shapes. If the reconstructed shape is moved to be in a different volume in space, the IoU might be zero (because there is no overlap) even if the shapes are identical.</p><p>In the implicit decoder paper, the authors use a different measure of 3D shape similarity &#8211; <a href="https://onlinelibrary.wiley.com/doi/abs/10.1111/1467-8659.00669">LFD</a>. This measure is invariant to scale of model, alignment and position (translation). The basic idea is to take&nbsp;10 silhouette images of the model from angles on a dodecahedron and 10 different&nbsp;dodecahedrons per model.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tQee!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd768ed0c-bba7-4c37-8989-10e2f49825e6_530x213.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tQee!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd768ed0c-bba7-4c37-8989-10e2f49825e6_530x213.png 424w, https://substackcdn.com/image/fetch/$s_!tQee!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd768ed0c-bba7-4c37-8989-10e2f49825e6_530x213.png 848w, https://substackcdn.com/image/fetch/$s_!tQee!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd768ed0c-bba7-4c37-8989-10e2f49825e6_530x213.png 1272w, https://substackcdn.com/image/fetch/$s_!tQee!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd768ed0c-bba7-4c37-8989-10e2f49825e6_530x213.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tQee!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd768ed0c-bba7-4c37-8989-10e2f49825e6_530x213.png" width="530" height="213" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d768ed0c-bba7-4c37-8989-10e2f49825e6_530x213.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:213,&quot;width&quot;:530,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!tQee!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd768ed0c-bba7-4c37-8989-10e2f49825e6_530x213.png 424w, https://substackcdn.com/image/fetch/$s_!tQee!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd768ed0c-bba7-4c37-8989-10e2f49825e6_530x213.png 848w, https://substackcdn.com/image/fetch/$s_!tQee!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd768ed0c-bba7-4c37-8989-10e2f49825e6_530x213.png 1272w, https://substackcdn.com/image/fetch/$s_!tQee!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd768ed0c-bba7-4c37-8989-10e2f49825e6_530x213.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">10 dodecahedrons</figcaption></figure></div><p>Then, when comparing between two models, compare the visual similarity of the images from these 10&nbsp;dodecahedrons using&nbsp;<a href="https://en.wikipedia.org/wiki/Fourier_series">Fourier </a>and <a href="https://en.wikipedia.org/wiki/Zernike_polynomials">Zernike </a>coefficients.</p><h3>References</h3><ul><li><p>Implicit Decoder: Chen, Zhiqin, and Hao Zhang. &#8220;Learning implicit fields for generative shape modeling.&#8221; <em>Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition</em>. 2019.</p></li><li><p>Shapenet: <a href="https://www.shapenet.org/">https://www.shapenet.org/</a></p></li><li><p>LFD: Chen, Ding&#8208;Yun, et al. &#8220;On visual similarity based 3D model retrieval.&#8221; <em>Computer graphics forum</em>. Vol. 22. No. 3. Oxford, UK: Blackwell Publishing, Inc, 2003.</p></li></ul>]]></content:encoded></item><item><title><![CDATA[The deep learning dictionary]]></title><description><![CDATA[Important and recurring phrases in neural networks and what do they mean]]></description><link>https://www.peternaf.com/p/the-deep-learning-dictionary</link><guid isPermaLink="false">https://www.peternaf.com/p/the-deep-learning-dictionary</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Mon, 11 Nov 2019 11:27:30 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/cdeafc84-c7c6-4a4b-b288-45478de4d2b7_1024x342.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In previous and future posts I am referring to different terms from the AI and deep learning world, for example, encoding-decoding in:</p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;df646b32-6033-4f9b-952d-d3bfd2dc1a54&quot;,&quot;caption&quot;:&quot;Back again with another AI and 3D reconstruction post for you This time, a special article, with many cool discoveries, I might write following posts about it. This is the highest quality 3D reconstruction from 1 image research I have seen yet. An encoding-decoding type of neural network to encode the 3D structure of a shape from a 2D image and then de&#8230;&quot;,&quot;cta&quot;:&quot;Read full story&quot;,&quot;showBylines&quot;:true,&quot;size&quot;:&quot;sm&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Implicit-Decoder part 1 &#8211; 3D reconstruction&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:57204161,&quot;name&quot;:&quot;Peter Naftaliev&quot;,&quot;bio&quot;:&quot;Software engineer, entrepreneur | \&quot;The sculpture is already complete within the marble block, before I start my work. It is already there, I just have to chisel away the superfluous material.\&quot; Michelangelo [not the turtle] &quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5b34314b-8678-4d52-a950-76a8e7d5cc9c_2779x2779.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;post_date&quot;:&quot;2019-10-11T12:34:30.000Z&quot;,&quot;cover_image&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b7e4f6a4-b7f1-4432-a170-5b14fb7f4feb_716x275.png&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://www.peternaf.com/p/implicit-decoder-part-1-3d-reconstruction&quot;,&quot;section_name&quot;:null,&quot;video_upload_id&quot;:null,&quot;id&quot;:173411815,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:0,&quot;comment_count&quot;:0,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;Peter&#8217;s Substack&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/$s_!bgK2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7342014e-5a1f-4978-89ba-11439da362dd_144x144.png&quot;,&quot;belowTheFold&quot;:false,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>In this post we will explain their meaning. This post will be updated constantly to account for more terms that might not be written or new terms that become standard in the industry.</p><h3>What is encoder-decoder?</h3><ul><li><p>Encoder &#8211; Maps input data (features) into a different representation. Usually the representation is in a lower space, allowing both for compression of the input data and more efficient representation of the important parts of the input.</p></li><li><p>Decoder &#8211; Maps encoded data into output data. The decoder is trained to understand the underlying representation of the original pre-encoded input data based on the encoded features and can produce output based on this underlying representation.</p></li></ul><h4>What is autoencoder?</h4><p>An autoencoder is a type of encoder-decoder network where the decoder outputs the encoded data back to its&#8217; original input structure. Why is it an interesting type of network?</p><ol><li><p>It allows for compression of data (for example, images) and then reconstructing back the original data with low data loss.</p></li><li><p>Training and autoencoder is a good method to train an encoder network to be a dimensionality reduction tools (much like PCA) which can represent the input data in a lower dimension vector, keeping the information about the important parts of the data.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2_y6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfd9bdf-2fdd-4937-96ce-97a66a5f1c56_299x168.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2_y6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfd9bdf-2fdd-4937-96ce-97a66a5f1c56_299x168.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2_y6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfd9bdf-2fdd-4937-96ce-97a66a5f1c56_299x168.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2_y6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfd9bdf-2fdd-4937-96ce-97a66a5f1c56_299x168.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2_y6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfd9bdf-2fdd-4937-96ce-97a66a5f1c56_299x168.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2_y6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfd9bdf-2fdd-4937-96ce-97a66a5f1c56_299x168.jpeg" width="299" height="168" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cdfd9bdf-2fdd-4937-96ce-97a66a5f1c56_299x168.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:168,&quot;width&quot;:299,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!2_y6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfd9bdf-2fdd-4937-96ce-97a66a5f1c56_299x168.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2_y6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfd9bdf-2fdd-4937-96ce-97a66a5f1c56_299x168.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2_y6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfd9bdf-2fdd-4937-96ce-97a66a5f1c56_299x168.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2_y6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcdfd9bdf-2fdd-4937-96ce-97a66a5f1c56_299x168.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><figcaption class="image-caption">Autoencoder</figcaption></figure></div><h3>What is RNN (recurrent neural network)?</h3><p>Neural networks are usually considered as a single input-output calculation. You put input information, the network runs and brings out an output. But, what if we have an input with uncertain size or length. For example, what if the input is textual, and can be constructed from 10 words or another time from 1000 words? And what if the output size is also uncertain? For example, the input text is in English and we want a French translation output which can be constructed from 10 words or another time from 1000 words?</p><p>This is where recurrent neural networks come to play. In recurrent neural network the structure of the network allows it to get one piece of input at a time and save history from previous calculations of the network. This can allow our translation example to work as follows: The network gets as an input only one word each time in English and can output only one word each time in French, keeping history of calculations for previous words. This allows for dynamically changing length of input\output while also using the context of previous input\output to understand what should be next. Language sentences usually have a grammatic and semantic structure which should be followed based on previous and future words in the sentence. Other examples of RNNs are: time series predictions, video analysis, movement tracking, robotic sensory input\output and any type of data which comes in a form of a temporal changing sequence.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mrW1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96dcd54c-9db3-4d7b-b1c8-7a3e9feefe5a_1024x342.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mrW1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96dcd54c-9db3-4d7b-b1c8-7a3e9feefe5a_1024x342.png 424w, https://substackcdn.com/image/fetch/$s_!mrW1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96dcd54c-9db3-4d7b-b1c8-7a3e9feefe5a_1024x342.png 848w, https://substackcdn.com/image/fetch/$s_!mrW1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96dcd54c-9db3-4d7b-b1c8-7a3e9feefe5a_1024x342.png 1272w, https://substackcdn.com/image/fetch/$s_!mrW1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96dcd54c-9db3-4d7b-b1c8-7a3e9feefe5a_1024x342.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mrW1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96dcd54c-9db3-4d7b-b1c8-7a3e9feefe5a_1024x342.png" width="1024" height="342" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/96dcd54c-9db3-4d7b-b1c8-7a3e9feefe5a_1024x342.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:342,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!mrW1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96dcd54c-9db3-4d7b-b1c8-7a3e9feefe5a_1024x342.png 424w, https://substackcdn.com/image/fetch/$s_!mrW1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96dcd54c-9db3-4d7b-b1c8-7a3e9feefe5a_1024x342.png 848w, https://substackcdn.com/image/fetch/$s_!mrW1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96dcd54c-9db3-4d7b-b1c8-7a3e9feefe5a_1024x342.png 1272w, https://substackcdn.com/image/fetch/$s_!mrW1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96dcd54c-9db3-4d7b-b1c8-7a3e9feefe5a_1024x342.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">RNN</figcaption></figure></div><h4>What is LSTM (long short term memory)?</h4><p>LSTM is a specific implementation of an RNN. LSTM keeps the state of the network, along with output and history of previous calculation. In LSTM there are 3 gates which decide how data flows:</p><ol><li><p>Input gate &#8211; Calculates how much of the new data (Xt in the diagram) and old output (Ht-1) to add to the new state (Ct)</p></li><li><p>Forget gate &#8211; Calculates&nbsp;how much of the old state (Ct-1) to keep based on the new data (Xt in the diagram) and old output (Ht-1)</p></li><li><p>Output gate &#8211; Calculates how much of the the new state (Ct) to output and also keep as history in this step of the network calculation, based on the&nbsp;new data&nbsp;(Xt in the diagram) and old output (Ht-1)</p></li></ol><p>The input and forget gates are combined to calculate the new state (Ct)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BHNj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed785c7d-3bbf-4f5a-88a5-8ea18122fb0e_1024x563.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BHNj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed785c7d-3bbf-4f5a-88a5-8ea18122fb0e_1024x563.png 424w, https://substackcdn.com/image/fetch/$s_!BHNj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed785c7d-3bbf-4f5a-88a5-8ea18122fb0e_1024x563.png 848w, https://substackcdn.com/image/fetch/$s_!BHNj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed785c7d-3bbf-4f5a-88a5-8ea18122fb0e_1024x563.png 1272w, https://substackcdn.com/image/fetch/$s_!BHNj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed785c7d-3bbf-4f5a-88a5-8ea18122fb0e_1024x563.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BHNj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed785c7d-3bbf-4f5a-88a5-8ea18122fb0e_1024x563.png" width="1024" height="563" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ed785c7d-3bbf-4f5a-88a5-8ea18122fb0e_1024x563.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:563,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!BHNj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed785c7d-3bbf-4f5a-88a5-8ea18122fb0e_1024x563.png 424w, https://substackcdn.com/image/fetch/$s_!BHNj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed785c7d-3bbf-4f5a-88a5-8ea18122fb0e_1024x563.png 848w, https://substackcdn.com/image/fetch/$s_!BHNj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed785c7d-3bbf-4f5a-88a5-8ea18122fb0e_1024x563.png 1272w, https://substackcdn.com/image/fetch/$s_!BHNj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed785c7d-3bbf-4f5a-88a5-8ea18122fb0e_1024x563.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">LSTM</figcaption></figure></div><h3>What is CNN (convolutional neural network)?</h3><p>When we look at a visual scene with our eyes, a similar scanning processes occurs in our mind no matter if we are looking at something large, something narrow, a specific part of the scene or the entire scene. Our brain takes a segment from our field of vision and analysis it in a repeating manner &#8211; searching for patterns, recognizing constructs, recognizing familiar shapes etc.</p><p>CNNs are a method of reconstructing that same process in a computer neural network. Instead of taking each input feature as a unique part of the entire input, the neural network is constructed to look at segments of the input in the same manner, no matter which segment and at the same time understand the construct of the entire input data and how the different features interact with each other.</p><p>A common use of CNNs is in visual input analysis (image, video, 3D model etc.). When analyzing an RGB image a CNN scans the input image using a moving window of predefined size and neural network weights. This window shrinks the information it sees each time. The entire image is scanned with this same window, creating a smaller representation of the image. Then again another window with fixed size and neural network weights is scanned over the more compact representation of the image etc. Until, we decide the the representation is compact enough and we add layers that do a specific function we choose. One of the common examples is identifying what is seen in the image, in which case a simple classification neural network structure can be added.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AdDV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4e89718-40ca-4bb4-a80b-5c4a307e240e_1024x315.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AdDV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4e89718-40ca-4bb4-a80b-5c4a307e240e_1024x315.png 424w, https://substackcdn.com/image/fetch/$s_!AdDV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4e89718-40ca-4bb4-a80b-5c4a307e240e_1024x315.png 848w, https://substackcdn.com/image/fetch/$s_!AdDV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4e89718-40ca-4bb4-a80b-5c4a307e240e_1024x315.png 1272w, https://substackcdn.com/image/fetch/$s_!AdDV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4e89718-40ca-4bb4-a80b-5c4a307e240e_1024x315.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AdDV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4e89718-40ca-4bb4-a80b-5c4a307e240e_1024x315.png" width="1024" height="315" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d4e89718-40ca-4bb4-a80b-5c4a307e240e_1024x315.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:315,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!AdDV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4e89718-40ca-4bb4-a80b-5c4a307e240e_1024x315.png 424w, https://substackcdn.com/image/fetch/$s_!AdDV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4e89718-40ca-4bb4-a80b-5c4a307e240e_1024x315.png 848w, https://substackcdn.com/image/fetch/$s_!AdDV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4e89718-40ca-4bb4-a80b-5c4a307e240e_1024x315.png 1272w, https://substackcdn.com/image/fetch/$s_!AdDV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4e89718-40ca-4bb4-a80b-5c4a307e240e_1024x315.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">CNN on image</figcaption></figure></div><p>CNNs are important because they allow for a faster and more efficient method to analyze a large sized input (such as large image or video), while also allowing for shift and scale invariance &#8211; no matter in which part of the image an object appears, nor it size (as long as it is seen), it can be identified with the same CNN.</p><h3>What are generative networks?</h3><p>Generative neural networks are networks which are trained to generate new data, new images, new signals, many times based on a random input. Imagine generating a sentence in French (similarly to what we discussed above), but instead of having an English sentence as input, the input can be anything (even random characters in whatever language) and the output will be a clear sentence in French. By the way, the architecture this French generating network can be exactly the same as the architecture of a network which translates English to French.</p><h4>What is GAN (generative adversarial network)?</h4><p>What is similar between the 3 images below? They are all images of non-existing people, generated by a GAN and taken from this website:&nbsp;<a href="https://thispersondoesnotexist.com/">https://thispersondoesnotexist.com/</a></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Dd2f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40095930-53f1-4346-a6e8-6e135dc4d4d7_1024x236.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Dd2f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40095930-53f1-4346-a6e8-6e135dc4d4d7_1024x236.png 424w, https://substackcdn.com/image/fetch/$s_!Dd2f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40095930-53f1-4346-a6e8-6e135dc4d4d7_1024x236.png 848w, https://substackcdn.com/image/fetch/$s_!Dd2f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40095930-53f1-4346-a6e8-6e135dc4d4d7_1024x236.png 1272w, https://substackcdn.com/image/fetch/$s_!Dd2f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40095930-53f1-4346-a6e8-6e135dc4d4d7_1024x236.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Dd2f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40095930-53f1-4346-a6e8-6e135dc4d4d7_1024x236.png" width="1024" height="236" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/40095930-53f1-4346-a6e8-6e135dc4d4d7_1024x236.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:236,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Dd2f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40095930-53f1-4346-a6e8-6e135dc4d4d7_1024x236.png 424w, https://substackcdn.com/image/fetch/$s_!Dd2f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40095930-53f1-4346-a6e8-6e135dc4d4d7_1024x236.png 848w, https://substackcdn.com/image/fetch/$s_!Dd2f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40095930-53f1-4346-a6e8-6e135dc4d4d7_1024x236.png 1272w, https://substackcdn.com/image/fetch/$s_!Dd2f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40095930-53f1-4346-a6e8-6e135dc4d4d7_1024x236.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">GANs &#8211; This person does not exist</figcaption></figure></div><p>GANs are a method of creating high quality generative neural networks. In GANs we train two neural networks &#8211; a generative network and a discriminator network. The generative network is trained to produce results which can &#8220;fool&#8221; the discriminator to think this is real data, while the discriminator is trained to recognize what data is fake and what is real. During training the discriminator is fed with real data which is labeled as such, and fake data which is labeled as such. The generator is trained with positive enforcement every time it is able to &#8220;fool&#8221; the discriminator and negative enforcement every time it is unable. Below is a general overview of a GAN which is trained to generate fake images.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cDOB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56f9dc9-82ff-4be1-bdf7-06992b54b0ba_790x332.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cDOB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56f9dc9-82ff-4be1-bdf7-06992b54b0ba_790x332.png 424w, https://substackcdn.com/image/fetch/$s_!cDOB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56f9dc9-82ff-4be1-bdf7-06992b54b0ba_790x332.png 848w, https://substackcdn.com/image/fetch/$s_!cDOB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56f9dc9-82ff-4be1-bdf7-06992b54b0ba_790x332.png 1272w, https://substackcdn.com/image/fetch/$s_!cDOB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56f9dc9-82ff-4be1-bdf7-06992b54b0ba_790x332.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cDOB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56f9dc9-82ff-4be1-bdf7-06992b54b0ba_790x332.png" width="790" height="332" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b56f9dc9-82ff-4be1-bdf7-06992b54b0ba_790x332.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:332,&quot;width&quot;:790,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!cDOB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56f9dc9-82ff-4be1-bdf7-06992b54b0ba_790x332.png 424w, https://substackcdn.com/image/fetch/$s_!cDOB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56f9dc9-82ff-4be1-bdf7-06992b54b0ba_790x332.png 848w, https://substackcdn.com/image/fetch/$s_!cDOB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56f9dc9-82ff-4be1-bdf7-06992b54b0ba_790x332.png 1272w, https://substackcdn.com/image/fetch/$s_!cDOB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb56f9dc9-82ff-4be1-bdf7-06992b54b0ba_790x332.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">GANs &#8211; Fake image architecture</figcaption></figure></div>]]></content:encoded></item><item><title><![CDATA[Survival guide for writing a Provisional Patent Yourself]]></title><description><![CDATA[Things I learned about provisional patenting while drafting one for an AI software algorithm]]></description><link>https://www.peternaf.com/p/survival-guide-for-writing-a-provisional-patent-yourself</link><guid isPermaLink="false">https://www.peternaf.com/p/survival-guide-for-writing-a-provisional-patent-yourself</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Sat, 09 Nov 2019 23:10:44 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/b7217b20-f659-46fa-8eef-f08b5b4e7a0b_1200x643.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This post will describe the things I learned about patent writing while writing a provisional patent for an AI algorithm. It is based on my own personal notes when writing the provisional as well as my experience of the process. The post is directed to people who want to defend their invention\IP (intellectual property), people who want to understand where to start and end with provisional patent writing and people who are wondering if to employ a patent writer or do it themselves. I am not a patent lawyer, so do not take my advice as given, consult a patent lawyer for true practitioner input.</p><h3>Prerequisites (all of these are straightforward and easy to find online explanations):</h3><ol><li><p>Basic knowledge of provisional patent &#8211; what is it good for, why is it used.</p></li><li><p>Know the structure required for a provisional patent (summary, description, claims etc.)</p></li><li><p>Know the difference between a provisional patent and a patent</p></li><li><p>Do your own patent research and find similar patents in a similar field. This is good both for reference and to understand how you need to write and style your patent</p></li></ol><h3>Mystical phrases and what do they mean</h3><h4>Someone who is skilled in the art</h4><p>This phrase is used to describe someone with knowledge of the domain you are writing the patent for. The phrase is used in order to explain that a certain term you are discussing is familiar in the patent field. For example, the sentence &#8220;a neural network gradient decent learning process will be used as is familiar to someone who is skilled in the art&#8221; will say that gradient decent is a standard procedure and you didn&#8217;t see the benefit of elaborating more as part of your patent application.</p><h4>Prior art</h4><p>Anything that is relevant to the subject of your patent which was a previous invention. It could come in a form of a previous patent, scientific publication, media publication, tutorial, youtube video and more.</p><h4>An embodiment</h4><p>An embodiment is one realization of the concepts you describe in your patent. For example, if your patent is an algorithm, then an embodiment of this algorithm can be one specific physical implementation of this algorithm on a PC machine, including how it interacts with the input and output devices of the machine. Another embodiment can be an implementation of the same algorithm in the cloud, including how the different cloud components and edge devices communicate to make this algorithm work and be consumed.</p><p>Or, if the algorithm has several different parts or options available, an embodiment will be a specific description of which parts are used. For example, if it is a 3D reconstruction algorithm from image and it can get as input the camera parameters, or, it can calculate the camera parameters itself. One embodiment will be a 3D reconstruction algorithm that gets camera parameters as input, another embodiment will be a 3D reconstruction algorithm which calculates camera parameters itself. A third embodiment will be a 3D reconstruction algorithm which can get the camera parameters, checks if the camera parameters are received and are valid, in case they are not received or valid &#8211; calculates the camera parameters.</p><p>In your patent application you want to have at least one embodiment, preferably at least the one which is the best one in the your eyes (usually this means the broadest one) &#8211; called the &#8220;preferred embodiment&#8221; or &#8220;best mode embodiment &#8220;. A preferred embodiment demonstrates that the inventor had in mind a specific implementation of his invention at the time of the patent filing, and he was not just making something up which is not feasible to make it work. If it is a software patent, make sure you have at-least one embodiment which specifies the physical implementation of the software &#8211; how it runs on machines, what type of machines, what are the required machine characteristics. Preferably put this embodiment in your claims also.</p><h4>Priority date</h4><p>The date in which you apply the provisional &#8211; this is the one that will be used in your patent&#8217;s application date, if you ever submit a non-provisional patent. It is important your priority date will be earlier than the competition, since this is what decides who the invention belongs to. The nice thing is that you can apply the provisional in one jurisdiction (for example, US) and then apply the patent based on this provisional in many jurisdiction (Europe, China etc.) keeping that first priority date. There are extra 60 days after applying the provisional to add all the material which is missing in the provisional and send another provisional, keeping the original priority date. This could extend to 90 days, but unclear exactly how and not guaranteed</p><h3>Goals of a patent (provisional or not)</h3><p>The formally stated goals of a patent are:</p><ol><li><p>Securing a priority date for your new invention.</p></li><li><p>Defending your invention from copies in two possible ways:</p><ol><li><p>If you do find someone who copied your invention you can sue them. If they are unable to prove that their copy is actually an original invention of theirs, you will win the lawsuit and be entitled for compensation.</p></li><li><p>Defending from getting sued by previous patent holders. If someone has a patent with an earlier priority date for an invention which is similar to yours but not exact, they might try to sue you by challenging your patent. If your patent indeed has something new over the prior art of the entity suing (this novelty has to appear and be written in your claims) and the court confirms this to be so, you are entitled for your invention and can enjoy its&#8217; fruits.</p></li></ol></li></ol><p>Notice &#8211; your patent and its&#8217; content do not have any other real tangible meaning. So, in case no-one copies your invention, or someone copies and you decide not to take action against it, or, you don&#8217;t get sued for infringing on someone else&#8217;s IP, everything written in your patent does not really hold any value. In this case, the patent is there much like a security alarm in a private house &#8211; it shows you thought of defense, but doesn&#8217;t hold any real meaning until a really burglar tries to break in. When the burglar does decide to break in, then the alarm is truly tested to see if it works, or in the patent case, the patent is tested to see if it is defensible.</p><p>Once a patent (non-provisional) is published, everyone has access to it and everyone can exactly see what your invention is and how it works. But, presumably, no-one is allowed to copy your invention until the patent expires, that is, if the patent is defensible.</p><p>In the startup world, many people will tell you investors want to see that you have patents as an IP asset, which seems to be true when searching for investment. While many entrepreneurs and business people will tell you that patents are not interesting because of three main reasons:</p><ol><li><p>No-one will sue you when you&#8217;re a small startup. The only real patent suits happen between big companies (the Googles, Samsungs, Apples of the world) and if you&#8217;ve reached a state where you&#8217;re big enough for patent lawsuits you&#8217;ve done alright for yourself and you&#8217;re not really a startup anymore.</p></li><li><p>Many times patents aren&#8217;t really defensible, especially software and chemistry patents &#8211; which are easy to tweak a bit and override the patent defenses &#8211; making your invention visible to all and not defensible. By the way, legend says this is why Coca-Cola never published their sauce recipe as a patent and keep it secret instead.</p></li><li><p>When you&#8217;re a startup, you got a million other things to worry about, usually regarding immediate business, and thinking 5-10 years ahead what could happen if your invention becomes truly big and successful and you will be in an IP battle, instead of working on it to become big and successful is a waste of resources.</p></li></ol><h4>Wait, so why write a software patent?</h4><ol><li><p>If your patent is defensible, you got a good IP asset.</p></li><li><p>You can use the patent as a warning flag for competitors (much like a house alarm). Patent lawsuits can be expensive and energy consuming, so people might be deterred from copying you just because of this threat.</p></li><li><p>It helps when talking to investors.</p></li></ol><h3>Writing guidelines</h3><h4>Claims</h4><p>Claims is where you distinguish your invention from the rest. When your patent is challenged your claims are checked against the claims of the challenger, if you have a claim that he doesn&#8217;t have then your patent can be defended. When writing a claim it is important to describe how the various components are structured and how the various components interact and connect. It is necessary to describe the invention so that it is complete, so that it works, but also so that it is different than what is known in the prior art. In order to define an invention that is new and non-obvious you must include something in the claim that is different than what is found in the prior art.</p><p>A claim might be:</p><ol><li><p>Improvement of prior art by adding something to an existing invention.</p></li><li><p>Improvement of prior art by reducing something from a previous invention, making it simpler, cheaper, lighter etc.</p></li><li><p>Completely new invention, never existing in part or whole in prior art.</p></li></ol><p>Your aim should be to have some patent claims you think are unique, but which are exceptionally broad. You should also use dependent-claims which are more narrow claims which present a specific version of the invention. Use dependent-claims to describe all the different options of the invention. Also, make sure to write dependent claims which you think represent the best version of the invention. In this way, you have both broad and narrow definitions of your invention, making it more defensible. When you will file a non-provisional this will force the patent office to consider your invention more seriously.</p><p>At the beginning of the claims section, start with &#8220;I claim,&#8221; or &#8220;The invention claimed is&#8221; and only then start listing all the claims. Each claim must begin with a capital letter and end with a period. Periods may not be used elsewhere in the claims except for abbreviations. What this means is that each claim can be only one sentence. This is true regardless of how tortured the sentence structure is and how incomprehensible the sentence may be to those not trained in patent claim drafting. When drafting a claim start with something like this: 1. A {insert title} comprising: {list the parts one by one} {then explain how each are connected}</p><p>Where a claim sets forth a plurality of elements or steps, each element or step of the claim can be separated by a line indentation. It is possible to enumerate the claims with numbers, and reference claims in their dependent-claims using these numbers. Reference characters and numbers from the description and drawings can be used in the claims also, enclosed within parentheses.</p><blockquote><p>Example of the first two claims (regular and dependent) from a patent by google for 3D search (US 8,686,992 B1)</p><p>What is claimed is:<br><br>1. A computer implemented method of 3D shape retrieval from a query 3D model, comprising: extracting, by one or more processing device, a plurality of features of the query 3D model; generating, by the one or more processing devices, a representation of the query 3D model; calculating, by the one or more processing devices, a first correlation by combining first coefficients associated with the representation of the query 3D model and second coefficients associated with representations of 3D models in the repository to obtain a first output and calculating an inverse rotational Fourier transform of the first output to obtain the first correlation, wherein a number of the first and second coefficients depends on a specified first bandwidth associated with the transform; calculating, by the one or more processing devices, a first similarity score based on the correlation; ranking, by the one or more processing devices, the 3D models based on the first similarity score; calculating, by the one or more processing devices, a second correlation by combining third coefficients associated with the representation of the query 3D model and fourth coefficients associated with representations of 3D models in the repository to obtain a second output and calculating an inverse rotational Fourier transform of the second output to obtain the second correlation, wherein a number of the third and fourth coefficients depends on a specified second bandwidth associated with the trans form, the second bandwidth being higher than the first bandwidth: calculating, by the one or more processing devices, a second similarity score based on the second correlation; ranking, by the one or more processing devices, the 3D models used in the second correlation based on the second similarity score; and returning, by the one or more processing devices, one or more 3D models. <br><br>2. The computer implemented method of claim 1, further comprising: determining, by the one or more processing devices, a plurality of matching scores between the query 3D model and the 3D models in the repository for each rotational alignment of the query 3D model; and Selecting, by the one or more processing devices, the high est score from the plurality of matching scores based on the determining step.</p></blockquote><h4>Description</h4><p>Following are things to consider, write, notice and remark on when writing the description part of your patent.</p><p>Specification of how the invention\software work:</p><ul><li><p>How the software operates from the perspective of the computer, not the perspective of the user? Describe the overall computer architecture of the system within which the software will exist. Define invention in terms of an overall system that has tangible components. Explain how things will be run, how will the process be implemented (hardware, processor, software architecture). Describe as many tangible things as possible. What are those tangible components? Databases, servers, receivers, transmitters, memory?</p></li><li><p>Explain each technical details of achieving the goals of the invention in its&#8217; own section.</p></li><li><p>Describe the desired functionality, including the different paths the process can take (things not working as expected) and then describe how to reach that desired functionality.</p></li><li><p>How are things connected and interact? What are the alternatives for making, connection, interaction?</p></li><li><p>The description of a software\algorithm patent should be enough for someone who is skilled in the art &#8211; a code developer &#8211; to be able to write the code that implements my invention.</p></li><li><p>If possible, add code\pseudocode samples.</p></li></ul><p>General description writing guidelines:</p><ul><li><p>Write as if the invention is complete and everything was tested and validated.</p></li><li><p>Explain how the goal of the invention is achieved.</p></li><li><p>Write simple explanations that a reasonably educated person can understand.</p></li><li><p>Describe every possible version of the patent, even those that make less sense, as long as they can work in any way:</p><ul><li><p>Describe the single best and most complete way to make your invention, including any and all options, preferences, constructs, processes and more.</p></li><li><p>Describe how to make your invention in a way that leaves out all options, constructs , processes except for those that are absolutely necessary for the invention to work.</p></li><li><p>Add best mode embodiment.</p></li></ul></li><li><p>Define any term you use exactly, so there won&#8217;t be any possible ambiguity. The specification should serve as a glossary to the claim terms so that those who will read the patent can clearly ascertain the meaning of the claim terms.</p></li><li><p>Explain any non-obvious or counter-intuitive steps, connections or limitations.</p></li><li><p>Pay particular attention to any preparations that may be necessary prior to beginning the making or using process.</p></li><li><p>Explain how to use the invention. Think of other ways the invention can be used even if it&#8217;s inferior. What are the functions or features that consumers will identify as an advantage?</p></li></ul><p>References to prior art:</p><ul><li><p>Add examples of different previous techniques.</p></li><li><p>Explain what is specifically unique compared to the prior art.</p></li></ul><h4>Photos and diagrams</h4><ul><li><p>Flowcharts\Diagrams to prepare:</p><ul><li><p>A single flowchart that depicts the overall working of the software.</p></li><li><p>A series of flow charts that show with painstaking detail the various routines and subroutines that together connect to create and deliver the complete functionality of the computer system as enabled by the software.</p></li></ul></li><li><p>25-30 mm spacing from left and right of page.</p></li><li><p>20-25mm spacing from top and bottom of page.</p></li><li><p>Number the blocks in the diagram.</p></li><li><p>Number everything (1/10&#8230;).</p></li><li><p>Better to have black and white images and diagrams than colored.</p></li></ul><h3>General patent drafting guidelines</h3><ul><li><p>Do no publish anything about your invention on any medium (online, youtube, lecture, document to customer, news article, social media post, etc.) before you have filed the provisional, otherwise when your patent will be challenged it might not be defend-able since the invention was already public knowledge.</p></li><li><p>A provisional patent is kept private until the final patent is applied. Even then, no one goes over a provisional patent until there comes a time when the patent is challenged. Therefore, write as much as you can and as deeply as you can in the provisional. You could later decide if you want to file the regular patent based on it or not. You could choose if you want to keep the information private or not, but in case you will want to file the final patent an elaborate provisional will help you defend it better.</p></li><li><p>Anything you write in the provisional patent will be considered in case the patent gets challenged. Especially in the European and Chinese patent offices, if you didn&#8217;t specify something, or didn&#8217;t elaborate enough in the provisional, no matter if you later did specify in the final patent application, they will consider what you wrote in the provisional patent.</p></li><li><p>A single provisional patent can be the sources of several filed non-provisional patents, using the priority date of that first provisional patent.</p></li><li><p>Try to avoid writing relevance terms (such as approximately, closely, substantially). If you have to use them, make sure you define what the relevance means.</p></li><li><p>Don&#8217;t be too definite. For example, instead of saying something like &#8220;the <strong>only thing</strong> that makes the present invention unique is&#8230;&#8221; It is better to say something like &#8220;<strong>one of the things</strong> that makes the present invention unique is&#8230;&#8221;</p></li><li><p>Use the phrasing &#8220;one or more&#8221; for things that can be singular or plural.</p></li><li><p>Do not address you invention as simple, instead address it as is elegant.</p></li><li><p>Before writing the patent description, start with writing all your claims. This will help you understand later what you should be elaborating on and explaining more in the description.</p></li><li><p>Make sure fonts embedded in the PDF, or use an image PDF instead of textual.</p></li><li><p>AI Patents in computer vision are trendy nowadays, getting higher approval rates than other software patents. So, if you can set your field of invention to something related to this it might help later with your patent approval. (<a href="https://www.kilpatricktownsend.com/en/Insights/Publications/2019/4/PatentingTrendsStudy">https://www.kilpatricktownsend.com/en/Insights/Publications/2019/4/PatentingTrendsStudy</a>)</p></li><li><p>This blog has a lot of good information, but it is very repetitive and there is a lot of marketing content in between, so it takes time to find the valuable pieces: <a href="https://www.ipwatchdog.com/2017/05/27/invention-to-patent-101-everything-know-get-started/id=83792/">https://www.ipwatchdog.com/2017/05/27/invention-to-patent-101-everything-know-get-started/id=83792/</a></p></li></ul><h3>Concluding note</h3><p>It&#8217;s better to submit something quickly and fix it or add to it later than spend weeks drafting a perfect provisional (which won&#8217;t be perfect since you are not a professional accomplished patent writer). Set a specific date for you to finish writing the provisional and stick to it, I would recommend up to 12 days for the entire process if it is your first time (less if you&#8217;ve already done this before)</p>]]></content:encoded></item><item><title><![CDATA[3D search engine]]></title><description><![CDATA[This time a post about something we developed &#8211; a 3D search engine.]]></description><link>https://www.peternaf.com/p/3d-search-engine</link><guid isPermaLink="false">https://www.peternaf.com/p/3d-search-engine</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Sun, 13 Oct 2019 08:55:29 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rIWZ!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fcc7748-5616-4c6c-9177-20671172e987_1280x1280.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This time a post about something we developed &#8211; a 3D search engine.</p><p>User puts in an image of an object, the engine finds in an existing repository of 3D objects the most similar objects to what&#8217;s in the photo. In this demo&#8217;s repository there are 5000 models of chairs.</p><h2>How does it work?</h2><p>The technology works by mapping a 2D image into a representation of the underlying 3D features of the object within the image. Similar features are extracted from the 3D objects. Then, a similarity engine searches the 3D features from the image over the 3D features from the 3D objects.</p><p>The demo works for chairs, but this is just a demo The same principle technology could be applied to any type of object category. As long as the 3D objects have a geometric construct (mesh\stl\obj\choose your format) the engine can find it.</p><h4>Future ideas</h4><p>Connect this to thingiverse or grabcad or any other online 3D repository and allow for visual search over these repositories.</p>]]></content:encoded></item><item><title><![CDATA[Implicit-Decoder part 1 – 3D reconstruction]]></title><description><![CDATA[Back again with another AI and 3D reconstruction post for you This time, a special article, with many cool discoveries, I might write following posts about it.]]></description><link>https://www.peternaf.com/p/implicit-decoder-part-1-3d-reconstruction</link><guid isPermaLink="false">https://www.peternaf.com/p/implicit-decoder-part-1-3d-reconstruction</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Fri, 11 Oct 2019 12:34:30 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!29HK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18024e3c-ae9d-486b-a760-12881301b9fc_497x960.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Back again with another AI and 3D reconstruction post for you&nbsp; This time, a special article, with many cool discoveries, I might write following posts about it. This is the highest quality 3D reconstruction from 1 image research I have seen yet. An encoding-decoding type of neural network to encode the 3D structure of a shape from a 2D image and then decode this structure and reconstruct the 3D shape.</p><h4>Some details</h4><ul><li><p>Input image: 128X128 pixels</p></li><li><p>Transparent image background</p></li><li><p>Training and generation is done based on categories of similar objects</p></li><li><p>Output voxel: Base resolution is 64X64X64 voxels. But, can produce output in any required resolution (!) without retraining the neural network</p></li></ul><h4>Neural Network structure:&nbsp;</h4><ul><li><p>2D encoder&#8202;&#8212;&#8202;based on ResNet18. generates and encoding vector of size 128 (z-vector) from an input image</p></li><li><p>Decoder&#8202;&#8212;&#8202;simple 6 fully connected layers with 1 classification output neuron. Receives as input the z-vector and &#8211;<strong>1</strong>&#8211; 3D coordinate in space and classifies if the coordinate belongs within the mass of the object or not.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3L7s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4dc4995-a9c1-4084-90b2-103668746b18_716x275.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3L7s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4dc4995-a9c1-4084-90b2-103668746b18_716x275.png 424w, https://substackcdn.com/image/fetch/$s_!3L7s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4dc4995-a9c1-4084-90b2-103668746b18_716x275.png 848w, https://substackcdn.com/image/fetch/$s_!3L7s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4dc4995-a9c1-4084-90b2-103668746b18_716x275.png 1272w, https://substackcdn.com/image/fetch/$s_!3L7s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4dc4995-a9c1-4084-90b2-103668746b18_716x275.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3L7s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4dc4995-a9c1-4084-90b2-103668746b18_716x275.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e4dc4995-a9c1-4084-90b2-103668746b18_716x275.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!3L7s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4dc4995-a9c1-4084-90b2-103668746b18_716x275.png 424w, https://substackcdn.com/image/fetch/$s_!3L7s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4dc4995-a9c1-4084-90b2-103668746b18_716x275.png 848w, https://substackcdn.com/image/fetch/$s_!3L7s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4dc4995-a9c1-4084-90b2-103668746b18_716x275.png 1272w, https://substackcdn.com/image/fetch/$s_!3L7s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4dc4995-a9c1-4084-90b2-103668746b18_716x275.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><figcaption class="image-caption">Neural Network Structure</figcaption></figure></div><h4>How does reconstruction occur from this&nbsp;network?</h4><p>To reconstruct the entire structure of the object, all 3D coordinates in space are sent to the decoder (in the paper&#8217;s case there were 64X64X64 coordinates per object), along with the single z-vector from the image. The decoder classifies each coordinate and creates a representation of the 3D structure. This creates a voxel representation of the 3D object. Then, a <a href="https://en.wikipedia.org/wiki/Marching_cubes">marching cube</a> algorithm is used to create a mesh representation.</p><h3>Example of car category reconstruction</h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!29HK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18024e3c-ae9d-486b-a760-12881301b9fc_497x960.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!29HK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18024e3c-ae9d-486b-a760-12881301b9fc_497x960.jpeg 424w, https://substackcdn.com/image/fetch/$s_!29HK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18024e3c-ae9d-486b-a760-12881301b9fc_497x960.jpeg 848w, https://substackcdn.com/image/fetch/$s_!29HK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18024e3c-ae9d-486b-a760-12881301b9fc_497x960.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!29HK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18024e3c-ae9d-486b-a760-12881301b9fc_497x960.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!29HK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18024e3c-ae9d-486b-a760-12881301b9fc_497x960.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/18024e3c-ae9d-486b-a760-12881301b9fc_497x960.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Implicit decoder 3D reconstruction example&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Implicit decoder 3D reconstruction example" title="Implicit decoder 3D reconstruction example" srcset="https://substackcdn.com/image/fetch/$s_!29HK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18024e3c-ae9d-486b-a760-12881301b9fc_497x960.jpeg 424w, https://substackcdn.com/image/fetch/$s_!29HK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18024e3c-ae9d-486b-a760-12881301b9fc_497x960.jpeg 848w, https://substackcdn.com/image/fetch/$s_!29HK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18024e3c-ae9d-486b-a760-12881301b9fc_497x960.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!29HK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18024e3c-ae9d-486b-a760-12881301b9fc_497x960.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Implicit-decoder 3D reconstruction of car image</figcaption></figure></div><p>First column is the input image, second column is the AI 3D reconstruction and last column is the original 3D object of the car (or, in the technical language&#8202;&#8212;&#8202;ground truth). The neural network in this image case was trained over models of cars. In the paper there are results for training over chairs, airplanes and more. Notice that the input-output image and voxel resolutions are specific in this paper, but can be changed accordingly for any required implementation.</p><h4>Wait! How is that last car reconstructed?</h4><p>The software didn&#8217;t even see the front of the car in the image. This is where the power of DL training comes from. Since we train the network over many previous examples of cars, it knows how to extrapolate the shape of a new car it never saw before. The extrapolation is possible because the network is trained over objects from a similar category, so the network effectively reconstructs similar structures it was trained on before which match the structure it sees in the image.</p><h2>Existing software for 3D reconstruction</h2><p>Nowadays there are many tools available that do 3D reconstruction from images. These tools use classic <a href="https://en.wikipedia.org/wiki/Photogrammetry">photogrammetry </a>techniques to reconstruct a 3D model from multiple images of the same object. Two examples:</p><ul><li><p><a href="https://agisoft.com">Agisoft</a></p></li><li><p><a href="https://www.autodesk.com/products/recap/overview">AutoDesk &#8211; Recap</a></p></li></ul><p>This type of software can benefit from the current AI research. Reconstruction of simple planes even if they are not completely seen in the image, handling light reflections or aberrations in the image, better proportion estimations and more. All these can be improved using similar neural network solutions.</p><h2>Similar research in previous post</h2><p><a href="https://2d3d.ai/index.php/2019/10/09/3d-scene-reconstruction-from-single-image/">3D scene reconstruction from single image</a> &#8211; was for scene reconstruction, the quality of single object reconstruction didn&#8217;t look as good, but it was impressive they achieved it from a natural scene image.</p><h3>ShapeNet</h3><p>Similar to ImageNet for images, ShapeNet is a large dataset of annotated 3D models along with competitions and groups of people who run ML research around the subject of 3D. Most (if not all) 3D ML research uses this dataset both for training and for bench-marking, including the implicit-decoder research. There are two main Shapenet datasets, the most current is ShapeNetCore.v2:&nbsp;</p><ul><li><p>55 common object categories&nbsp;</p></li><li><p>About 51,300 unique 3D models</p></li><li><p>Each 3D model&#8217;s category and alignment (position and orientation) are verified.</p></li></ul><h3>References</h3><ul><li><p>Research: [1] Chen, Zhiqin, and Hao Zhang. &#8220;Learning implicit fields for generative shape modeling.&#8221; <em>Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition</em>. 2019.</p></li><li><p>Shapenet: <a href="https://www.shapenet.org/">https://www.shapenet.org/</a></p><p></p></li></ul>]]></content:encoded></item><item><title><![CDATA[3D scene reconstruction from single image]]></title><description><![CDATA[This paper by Facebook research on how to use neural networks to analyze one image of a scene, segment it into the seen 3D models within it and automatically create meshes\voxels from that single image.]]></description><link>https://www.peternaf.com/p/3d-scene-reconstruction-from-single-image</link><guid isPermaLink="false">https://www.peternaf.com/p/3d-scene-reconstruction-from-single-image</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Wed, 09 Oct 2019 11:37:52 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1f5cd6e8-5e65-4d77-b2e6-60bd59ae6ebd_499x462.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This paper by Facebook research on how to use neural networks to analyze one image of a scene, segment it into the seen 3D models within it and automatically create meshes\voxels from that single image.<br>Link to paper: <a href="https://arxiv.org/abs/1906.02739?fbclid=IwAR2NGi69t1dHZDXFbZXkWlYRZHBeZaEp-38-CXthag4SHahmohSCu6KYj3E">https://arxiv.org/abs/1906.02739</a></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3AeG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3640e079-f7b3-4549-9032-bf281fb306dd_499x462.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3AeG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3640e079-f7b3-4549-9032-bf281fb306dd_499x462.png 424w, https://substackcdn.com/image/fetch/$s_!3AeG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3640e079-f7b3-4549-9032-bf281fb306dd_499x462.png 848w, https://substackcdn.com/image/fetch/$s_!3AeG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3640e079-f7b3-4549-9032-bf281fb306dd_499x462.png 1272w, https://substackcdn.com/image/fetch/$s_!3AeG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3640e079-f7b3-4549-9032-bf281fb306dd_499x462.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3AeG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3640e079-f7b3-4549-9032-bf281fb306dd_499x462.png" width="499" height="462" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3640e079-f7b3-4549-9032-bf281fb306dd_499x462.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:462,&quot;width&quot;:499,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Example of 3D scene reconstruction&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Example of 3D scene reconstruction" title="Example of 3D scene reconstruction" srcset="https://substackcdn.com/image/fetch/$s_!3AeG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3640e079-f7b3-4549-9032-bf281fb306dd_499x462.png 424w, https://substackcdn.com/image/fetch/$s_!3AeG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3640e079-f7b3-4549-9032-bf281fb306dd_499x462.png 848w, https://substackcdn.com/image/fetch/$s_!3AeG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3640e079-f7b3-4549-9032-bf281fb306dd_499x462.png 1272w, https://substackcdn.com/image/fetch/$s_!3AeG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3640e079-f7b3-4549-9032-bf281fb306dd_499x462.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Example of scene 3D reconstruction</figcaption></figure></div><h2>Why single image?</h2><p>Using multiple image will bring better results and reconstruction accuracy, so why use single images only?</p><h4><em>It&#8217;s easier</em></h4><p>Training datasets are more available for single image. The architecture of the neural network is easier to model and explain when it is a single image, it requires less computational resources to train over single image.</p><h4><em>It&#8217;s more interesting</em></h4><p>Once good reconstruction accuracy is reached with a single image, we know that the structure of the neural network is good. It is then possible to change this structure to add more images as input, be it changing the neural network itself, changing the input vector which it receives, averaging over the output of the network or other combination methods. So, actually, multi-image reconstruction is a subgroup of single image reconstruction.</p><h2>AI and humans</h2><p>Sometimes people get afraid that AI will replace us all. Well, if it will be able to reach singularity (can read more here <a href="https://waitbutwhy.com/2015/01/artificial-intelligence-revolution-1.html">https://waitbutwhy.com/2015/01/artificial-intelligence-revolution-1.html</a> ) then yes, it could happen. But, neural networks which transfer 2D images into 3D models is not what&#8217;s going to bring this change.<br>Current technological developments allow to minimize repetitive tasks of humans, and actually facilitate more time, money and energy for creative valuable tasks for humans.</p><p>This might lead to a change in the workforce structure in the future, creating new jobs and making older jobs obsolete, but so did the invention of the car (which almost eliminated the use for coachmen but allowed for more accessible transportation and creation of jobs for taxi\bus\truck drivers), the invention of the telegram and many more examples.</p><p>Imagine giving a 2D\3D artist a tool in which he can draw whatever shape he likes in 2D and a software can create a corresponding 3D representation, this might open new possibilities both for modelling, for art, for VR\AR, for printing and for other industries that might pop up in the future. Or, just in the short term, making 3D scanning and modelling a much cheaper and faster processes for makers.</p><h2><strong>Ideas for future research</strong></h2><ul><li><p>AI which gets as input a point cloud (instead of image) and reconstructs and accurate 2D mesh</p></li><li><p>Camera and lighting pose and parameters estimation</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Open Source Research – Code reuse]]></title><description><![CDATA[I&#8217;m back!]]></description><link>https://www.peternaf.com/p/open-source-research-code-reuse</link><guid isPermaLink="false">https://www.peternaf.com/p/open-source-research-code-reuse</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Mon, 05 Feb 2018 07:00:56 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/7cffd55b-8fd6-494c-8517-ec55a12f90dc_1202x1186.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I&#8217;m back!</p><p>So, what has been happening the past year? Well, for one thing, we have made progress in our open source research, created the data set, published a paper, I have finished my thesis and more is to come. The following blog posts will be focused on our research.</p><p>Back in January 2014 I joined Prof. Neil Gandal, Head of the Economics department and Dr. Uriel Stettner from the Business department in Tel Aviv university to work together on a research involving social science within the open source code development sphere.</p><p>The goals of our research is to better understand the open source community, what makes open source projects succeed, what type of commercial companies use open source, where do open source developers choose to work and why, what are the interactions between open source developers and projects and more.</p><p>My main focus in the research was to develop and investigate a data set of measures of &#8220;information spillovers&#8221; between projects. In other words, I constructed a network of flow of code between projects, searching for similar code files and code reuse between projects.</p><p>The work comprised of downloading all files from SourceForge from year 1996 to 2015. Then, parsing out the text to a uniform text format from all these files and creating a similarity measure between the different code files. I will explain the technical details on how it was all done in a different post.</p><p>Why SourceForge, and not, say, GitHub? SourceSorge exists from the 90s, it was the most popular platform long before GitHub. This allows us to run a thorough social science research over time, to check for temporal and trending changes.</p><p>Two main topics when looking for code flows:</p><ol><li><p>Finding similar code files:<br>We separated code files to programming languages.&nbsp; Within each language, we measured similarity between two files by examining the text of function names, variable names, code fragments and comments within the code. The similarity between documents is based on their joint score in vector space representation. Accordingly, every word in each document is assigned two scores: (1) Term Frequency (TF), which measures the number of times the word appears within the same document compared to all other words in the document and (2) Inverted Document Frequency (IDF), which measures the number of documents in the entire text universe (i.e., all files) in which the particular word appears. Thus, the importance of a word in a document is proportional to its TF score and inversely proportional to its IDF score. For example, in the context of our research, the word &#8220;source&#8221; is important because it appears many times in this document and does not likely appear in many other economic papers. On the other hand, the word &#8220;the&#8221; is less important, because it is common in the English language and appears in many other documents. Using a &#8220;standard&#8221; combined TF-IDF score of each word within a document (file,) we constructed a representation vector of size K, where K is the number of distinct words. Each entry in K is the TF-IDF score of the corresponding word. We then calculated the cosine distance between the vector scores of all pairs of files across projects to determine the similarity between the documents. We chose a minimum cutoff score for similarity, above which, every similarity pair is considered a proper reuse. We checked that score manually over 30 pairs of similar files to make sure that if their score is above the cutoff, they are indeed similar.</p></li><li><p>Creating a chronological order of the code files:<br>We looked at the addition date of a file. File X was considered a reuse of file Y if X was similar to Y (similarity score above the cutoff) and X was added to its&#8217; repository after Y.&nbsp; We then constructed a &#8220;reuse&#8221; connection network between the projects where project A has a directed connection to project B if there is at least one pair of similarity files belonging to these projects such that the original file belongs to A and the destination file belongs to B. Note that if Project B copied from Project A, and Project C copied the same file from project B, project A gets credit as the source in both cases.&nbsp; In this case, project B is just a facilitator and does not get credit as the source.</p></li></ol><p>At the first stage we focused on code files in Java, later we have also constructed the code flow network for C\C++. These are the dominant languages in SourceForge, comprising of 9M and 11M files, respectively. The next common language is C#, with less than 1M files.</p><p>Following is an example of how the Java code flow network looked like in 2005. The blue dots are projects and there is an arrow between two dots if code was transferred from one project to another.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MKAD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feefe676d-8845-49ac-8cfa-bd5721de34f0_1202x1186.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MKAD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feefe676d-8845-49ac-8cfa-bd5721de34f0_1202x1186.png 424w, https://substackcdn.com/image/fetch/$s_!MKAD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feefe676d-8845-49ac-8cfa-bd5721de34f0_1202x1186.png 848w, https://substackcdn.com/image/fetch/$s_!MKAD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feefe676d-8845-49ac-8cfa-bd5721de34f0_1202x1186.png 1272w, https://substackcdn.com/image/fetch/$s_!MKAD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feefe676d-8845-49ac-8cfa-bd5721de34f0_1202x1186.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MKAD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feefe676d-8845-49ac-8cfa-bd5721de34f0_1202x1186.png" width="1202" height="1186" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eefe676d-8845-49ac-8cfa-bd5721de34f0_1202x1186.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1186,&quot;width&quot;:1202,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;project code flow 2015.png&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="project code flow 2015.png" title="project code flow 2015.png" srcset="https://substackcdn.com/image/fetch/$s_!MKAD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feefe676d-8845-49ac-8cfa-bd5721de34f0_1202x1186.png 424w, https://substackcdn.com/image/fetch/$s_!MKAD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feefe676d-8845-49ac-8cfa-bd5721de34f0_1202x1186.png 848w, https://substackcdn.com/image/fetch/$s_!MKAD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feefe676d-8845-49ac-8cfa-bd5721de34f0_1202x1186.png 1272w, https://substackcdn.com/image/fetch/$s_!MKAD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feefe676d-8845-49ac-8cfa-bd5721de34f0_1202x1186.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div>]]></content:encoded></item><item><title><![CDATA[Information Flows Thesis Research]]></title><description><![CDATA[Following is the description of my thesis research, the main topic that I wanted to examine was to see how one&#8217;s social network centrality affects his credibility and his ability to spread information across the network.]]></description><link>https://www.peternaf.com/p/information-flows-thesis-research</link><guid isPermaLink="false">https://www.peternaf.com/p/information-flows-thesis-research</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Sun, 04 Feb 2018 10:58:13 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rIWZ!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fcc7748-5616-4c6c-9177-20671172e987_1280x1280.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Following is the description of my thesis research, the main topic that I wanted to examine was to see how one&#8217;s social network centrality affects his credibility and his ability to spread information across the network. This question has an interesting meaning within professional social networks in which actors are professionals that know how to measure the quality of information they are exposed to from their peers.</p><p>In this research, I have conducted the first in depth study of the behavior of information flows in the open source software (OSS) world. I made the first file-level global behavior research, taking advantage of the masses of available online OSS information from SourceForge between the years 2005-2013. I created an information flows network which is based on code copying and reuse across all these years. I combined the information flows network with previous social network researched in (Fershtman and Gandal 2011 and Gandal and Stettner 2014) to combine social network structure and interactions with exact measurement of information flow to figure out novel understanding on the way developers operate in OSS.</p><p>Several main questions were asked (and answered) in my research:</p><ol><li><p>Is the centrality of the developer or the project associated with information propagation?</p></li><li><p>How spread of open source code information looks over time and what is its&#8217; pace?</p></li><li><p>Is there Two Step Flow of Comomunication (Katz 1957) charactersitic to open source code, in which central actors bring in information to the network from external sources?</p></li><li><p>What is the reach of different code files over the network and how is it affected by the originator of these files?</p></li><li><p>Do central actors in the open source social network use their connection to gather code from peers which is relevant to their own projects?</p></li></ol><p>The Dataset:</p><p>Using the dataset of code similarities I created an information flow network for each year which was based on the quartet File-Project-Developer-Year.<br>Each node is a given code file, with outbound connections to other similar code files which were created up to the given year and an inbound connection if the code file was similar to a previously created file. A connection can exist between two nodes if and only if they belong to different projects and were created by different developers and both code files were created up to, including, the given year.</p><p>I combined the information flow network with two other network:<br>(i) Developer network: Two developers are connected in the network if both were members of the same project in the same year.<br>(ii) Project network: Two projects are connected in the network if both project had a mutual developer in the same year.</p><p>Spread of information over time:</p><p>Checking the reach of code files, developers and projects, I found there are power law effects taking place, there are a few developers, projects and code files which account for a very large number of copying and reuse. I then checked the speed of information spread via code reuse. I found evidence that correspond to theoretical and empirical social network information flows in which the pace of cumulative information spread in OSS over time is according to an S-Shape curve, or a bell curve if we look at the temporal distribution. Our data set showed an interesting phenomenon, in which the first years of the code existence are most important for its&#8217; spread and later years exhibit smaller code reuse, suggesting technological aging.</p><p>Central actors behavior:</p><p>My main results showed ambiguity with regard to how much centrality in the social network is associated with being a source and originator of information. The results suggest that what&#8217;s more important is the activity of the project itself, and validation that the code itself is indeed valuable through lower modification counts and more years of existence. I saw that the license agreement of a project has a direct effect on the amount its&#8217; code is reused. More permissive license types were associated with greater code spread.<br>I found that central developers in SourceForge act more as mavens than connectors, bringing new information into the network, rather than connecting developers and projects.</p><p>Two Step Communication Flows:</p><p>The online environment is ideal for two step communication flows (Katz 1957), because it is a setting in which actors can bring information from other online sources to their own social network, but using our dataset I was able to refute its&#8217; existence in SourceForge.</p><p>Concluding thoughts:</p><p>I have started the path of understanding and measuring social interactions and information spread in OSS on a large scale. But, I see there is still to be done with regards to homophily, aggregating social characteristics of all peers who reuse a code, understanding the importance of license agreements on code reuse and more.</p>]]></content:encoded></item><item><title><![CDATA[Open Source Research – Following the Code]]></title><description><![CDATA[Following is the description of the joint research Prof.]]></description><link>https://www.peternaf.com/p/open-source-research-following-the-code</link><guid isPermaLink="false">https://www.peternaf.com/p/open-source-research-following-the-code</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Sat, 03 Feb 2018 07:08:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rIWZ!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fcc7748-5616-4c6c-9177-20671172e987_1280x1280.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Following is the description of the joint research Prof. Neil Gandal Dr. Uriel Stettner and I were working on. Our main goal was to research how knowledge spillovers between different OSS projects affects projects&#8217; success and progress.</p><p>In the case of OSS development, knowledge spillovers (if they exist) likely occur via two channels</p><ol><li><p>Spillovers from Software reuse: Programmers take software code from one project and employ it in another project.</p></li><li><p>Spillovers from Common Programmers: Programmers take knowledge, know-how, and experience from one or more OSS project they work on and employ that knowledge on another OSS project they work on.</p></li></ol><p>The first channel includes (i) reuse from one project that a programmer is working on to another project he or she is working on as well as (ii) reuse from a project that has no common programmers with the relevant project. The second channel includes knowledge, know-how, and experience, other than software reuse. A key question is whether these spillovers exist in a large OSS network, and if they do, whether knowledge transfer enhances the performance of the projects involved. In previous work we examined how connections among software projects via common programmers affected the success of OSS projects (Fershtman and Gandal 2011; Gandal and Stettner 2016), We found evidence of positive spillovers, but since we could not measure reuse on a large scale, these spillovers include knowledge, know-how, experience, and reuse from other projects the programmer is working on. By directly measuring software reuse as well as network connections we can separately measure the importance of the two channels.</p><p>Direct knowledge spillovers occur when two projects have a common programmer who transfers knowledge, know-how and experience embedded in the code from one project to another. In contrast, indirect project spillovers occur when knowledge is transferred from one project to another when the two projects are not directly linked through a common programmer. For example, suppose that programmer &#8220;A&#8221; works on projects I and II, while programmer &#8220;B&#8221; works on projects II and III. Programmer A could take knowledge from project I and use it in project II. Programmer B might find that knowledge useful and take it from project II to project III. In such a case, knowledge is transferred from one project to another by programmers who work on more than one project. There is a direct spillover from project I to project II, and an indirect spillover from project I to project III, since projects I and III are not directly connected.</p><p>We calculate reuse measures for all projects in our data set, and examine whether reuse of software is associated with project success (controlling for other factors)</p><p>We used the same base network and datasets as described in: <a href="https://progressingineering.wordpress.com/2018/02/04/information-flows-thesis-research/">Information Flows Thesis Research</a>. We constructed a &#8220;reuse&#8221; connection network between the projects where project A has a directed connection to project B if there is at least one pair of similarity files belonging to these projects such that the original file belongs to A and the destination file belongs to B. Note that if Project B copied from Project A, and Project C copied the same file from project B, project A gets credit as the source in both cases. In this case, project B is just a facilitator and does not get credit as the source. Finally, we then added up all of the connections and defined the variables reuse_in and reuse_out for each project. &#8220;Reuse_in&#8221; is the number of other projects from which that project reused at least one software file. &#8220;Reuse_out,&#8221; is the number of projects to which the project &#8220;contributed&#8221; at least one software file. We also account for investment and effort in the project. Hence, we compute the number of modifications and additions made to the code for each project over the period between 2005 and 2008. A modification is defined as a change made by a programmer to existing code within a distinct file, while an addition occurs when a programmer adds a new file that contains a block of code that was not previously part of a focal OSS project. Thus, a modification captures an activity that affects a particular set of code with the desire to, for example, make the code more efficient or stable. Accordingly, modifications are a good proxy for incremental innovation that, for example, improve how the software product works via the refinement, reutilization, and elaboration of established ideas and technologies. Additions are a proxy for new knowledge that may provide additional functionality (Lewin, Long, &amp; Carroll, 1999)</p><p>Our key findings are:</p><ol><li><ol><li><p>Controlling for other factors that explain success, projects that reuse code from a greater number of projects have more success.</p></li><li><p>Even after controlling for software re-use effects, we find knowledge spillovers via common programmers among projects: projects that have more connections are more successful. This suggests that projects receive additional (i.e., non-code) knowledge spillovers from connected projects.</p></li></ol></li></ol><p>We see that knowledge spillovers take place via both channels discussed above and that both channels (reuse of code and other knowledge spillovers from connected projects) yield spillover benefits.<br>We then delineate reuse into two categories:</p><ol><li><p>Software reuse from connected projects, i.e., reuse from a project with a contributor in common with the relevant project.</p></li><li><p>Software reuse from unconnected projects, i.e., reuse from projects without a contributor in common with the relevant project.</p></li></ol><p>We find that reuse from connected projects is not statistically significant in explaining success, while reuse from unconnected projects is statistically significant. Overall, our results suggest that knowledge spillovers from neighboring products are primarily due to knowledge other than copying code, while &#8220;reuse&#8221; spillovers come from the general community of open source software projects. These results provide the first empirical support for knowledge spillovers via reused code in large open source software networks</p>]]></content:encoded></item><item><title><![CDATA[Open Source Research – Technical Work]]></title><description><![CDATA[Crawling]]></description><link>https://www.peternaf.com/p/open-source-research-technical-work</link><guid isPermaLink="false">https://www.peternaf.com/p/open-source-research-technical-work</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Thu, 01 Feb 2018 17:20:59 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rIWZ!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fcc7748-5616-4c6c-9177-20671172e987_1280x1280.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Crawling</em></p><p>We crawled all projects in SourceForge and saved their entire data from all years starting 1998. There were two main source code repository types used: SVN, CVS. CVS is an older implementation of code management, which is less used today.</p><p>Using management apis for SVN and CVS, we first tried creating a program which queries every project for its&#8217; content for every year of existence, taking only the files that changed within the year. This proved to be time consuming. We then changed tactics and just downloaded the entire repositories, virtually creating a copy of all the projects in SourceForge on our database. This was accumulated to about 8 TB of data.</p><p><em>Parsing</em></p><p>Each project is comprised of many different file types which hold relevant information: text code files, textual format documents, word documents, PDFs, compressed files which can contain more documents, configuration files and more. In order to use all this data, we needed to parse all the documents within a project and save them in a uniform format.</p><p>We created a program which was able to traverse the directory tree of every open source project, for every year of its&#8217; existence and extract the important information for each file, with the help of the open source project: <a href="https://sourceforge.net/projects/svn-search">svn-search</a> . For each file we extracted The text of the file, the author of the file, the last action preformed on the file&nbsp;within the corresponding year (edit, delete, add), time of the last action, the author of the last action, the comments of the last author of the file, size of file, location of the file in the project and more. We needed to adjust our program to handle both SVN and CVS repository types, parsing files which are unique to the ones we saw in SourceForge and saving them in our own XML format. This created a base of 1 TB of standardized data which we could then analyze.</p><p><em>Indexing</em></p><p>We used a Lucene based textual index to index code files for every programming language, focusing on an index for the programing languages Java and C\C++. Our XML formatted files were designated to work seamlessly with the lucene index. The Java source code index is comprised of 9 Million files across 130,000 projects. We divided it to 12 sub indexes (shards) in order to improve search performance, over a cluster of 2 physical servers each with 16 CPU cores, 128GB RAM and 500GB SSD hard disks. We added Java keywords to the list of stop words in Solr, so that these words do not account for when searching similarity.</p><p><em>Clearing Automatically created documents</em></p><p>Many code files are created by automated tools. This creates a bias in the dataset in which we think there was transfer of knowledge between two projects, when in fact, they just used the same automatic tool for code creation. To account for these code files and remove them from our sample, we used Solr again. We looked at samples of extremely similar code files and picked those that we saw were created by automated tools. These code files had textual signatures within them that pointed to their automatic creation. We searched these textual signatures within our code corpus using solr and removed thee files which answered the textual search query.</p><p><em>Data analysis</em></p><p>After we had the textual index we created a MySQL metadata index of these files. We created a Java program which ran similarity searches for all files in Solr and indexed the results in the Database.&nbsp; We then could run fast SQL queries over the data and create python network objects from it.</p><p><em>Social Network Analysis</em></p><p>We had past data regarding the connections of all code developers in Source Forge saved in our MySQL DB. We combined this data with the newly consturcted code flow dataset in order to extract meaningful social network insights.</p><p>We used NetworkX package for python to process network characteristics. To get statistical insights we used Pandas a data analysis Python package, R programming language and Stata.</p>]]></content:encoded></item><item><title><![CDATA[DataHack – FlyCatcher]]></title><description><![CDATA[A couple of weeks ago some friends and I have participated in a three day programming competition (Hackathon) centered around data mining and machine learning.]]></description><link>https://www.peternaf.com/p/datahave-flycatcher</link><guid isPermaLink="false">https://www.peternaf.com/p/datahave-flycatcher</guid><dc:creator><![CDATA[Peter Naftaliev]]></dc:creator><pubDate>Fri, 18 Dec 2015 09:16:40 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/a464f4fa-f24c-465a-8cc4-a877ab0cad84_2048x1365.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A couple of weeks ago some friends and I have participated in a three day programming competition (Hackathon) centered around data mining and machine learning. We won third place and self gratification.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!X69d!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f2b19f-6af0-4ba5-9152-a7a8b222f8ff_2048x1365.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!X69d!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f2b19f-6af0-4ba5-9152-a7a8b222f8ff_2048x1365.jpeg 424w, https://substackcdn.com/image/fetch/$s_!X69d!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f2b19f-6af0-4ba5-9152-a7a8b222f8ff_2048x1365.jpeg 848w, https://substackcdn.com/image/fetch/$s_!X69d!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f2b19f-6af0-4ba5-9152-a7a8b222f8ff_2048x1365.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!X69d!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f2b19f-6af0-4ba5-9152-a7a8b222f8ff_2048x1365.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!X69d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f2b19f-6af0-4ba5-9152-a7a8b222f8ff_2048x1365.jpeg" width="2048" height="1365" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/11f2b19f-6af0-4ba5-9152-a7a8b222f8ff_2048x1365.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1365,&quot;width&quot;:2048,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;12307562_10153683176449299_3174116549342585189_o&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="12307562_10153683176449299_3174116549342585189_o" title="12307562_10153683176449299_3174116549342585189_o" srcset="https://substackcdn.com/image/fetch/$s_!X69d!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f2b19f-6af0-4ba5-9152-a7a8b222f8ff_2048x1365.jpeg 424w, https://substackcdn.com/image/fetch/$s_!X69d!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f2b19f-6af0-4ba5-9152-a7a8b222f8ff_2048x1365.jpeg 848w, https://substackcdn.com/image/fetch/$s_!X69d!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f2b19f-6af0-4ba5-9152-a7a8b222f8ff_2048x1365.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!X69d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11f2b19f-6af0-4ba5-9152-a7a8b222f8ff_2048x1365.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Presenting FlyCatcher</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AH20!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed4fffa8-334a-4fc5-b78c-4817108f6496_1296x972.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AH20!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed4fffa8-334a-4fc5-b78c-4817108f6496_1296x972.jpeg 424w, https://substackcdn.com/image/fetch/$s_!AH20!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed4fffa8-334a-4fc5-b78c-4817108f6496_1296x972.jpeg 848w, https://substackcdn.com/image/fetch/$s_!AH20!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed4fffa8-334a-4fc5-b78c-4817108f6496_1296x972.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!AH20!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed4fffa8-334a-4fc5-b78c-4817108f6496_1296x972.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AH20!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed4fffa8-334a-4fc5-b78c-4817108f6496_1296x972.jpeg" width="1296" height="972" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ed4fffa8-334a-4fc5-b78c-4817108f6496_1296x972.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:972,&quot;width&quot;:1296,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;IMG-20151127-WA0006&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="IMG-20151127-WA0006" title="IMG-20151127-WA0006" srcset="https://substackcdn.com/image/fetch/$s_!AH20!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed4fffa8-334a-4fc5-b78c-4817108f6496_1296x972.jpeg 424w, https://substackcdn.com/image/fetch/$s_!AH20!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed4fffa8-334a-4fc5-b78c-4817108f6496_1296x972.jpeg 848w, https://substackcdn.com/image/fetch/$s_!AH20!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed4fffa8-334a-4fc5-b78c-4817108f6496_1296x972.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!AH20!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed4fffa8-334a-4fc5-b78c-4817108f6496_1296x972.jpeg 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>FlyCatcher Team</p><p>Bellow is a summary of what we did &#8211; Caution, technical stuff</p><p>Using historical data about flights, weather and machine learning we are able to predict if a flight will be delayed a day prior to its&#8217; schedule.</p><p>We find novel insights relating historical flight delays to future flight delays.</p><p>In particular, previous day delays in the airport and airline are found to contain high predictive power for next day flight delays, resulting in 77.6% accuracy of prediction.</p><p>Also, tracking flights of distinct airplanes results in 90% predictive accuracy of delays.</p><p>We looked at 10 years of flight and weather records.</p><p>We downloaded flight data from the USA Bureau of Transportation Statstics. It consisted of 500,000 civilian Inter-American flight details for each month. For weather, we got measurements from all meteorological stations in the US from the National Oceanic and Atmospheric Administration, including all the weather stations that are located within or in close proximity to airports. There was a weather measurement every 2 minutes for each station.</p><p>After working and examining the data we decided to focus on all records from 2014.</p><p>We started off by mapping busy flight lines across America. In the map bellow, the darker lines are those that have more flights going through them.</p><p>Next, we were interested to see the spread of flight delays as percentage of total flights on the same route. The Green lines in the map bellow indicate relatively few delays as part of total flights on the same line, the stronger the color the smaller the percentage of delayed flights. Red lines indicate routes with relatively more delays, the stronger the red the larger the portion of delayed flights as part of total flights on the same route.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3ccf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78f31367-bb93-4bfc-aa1f-0d4e35cbbc7b_1258x765.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3ccf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78f31367-bb93-4bfc-aa1f-0d4e35cbbc7b_1258x765.png 424w, https://substackcdn.com/image/fetch/$s_!3ccf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78f31367-bb93-4bfc-aa1f-0d4e35cbbc7b_1258x765.png 848w, https://substackcdn.com/image/fetch/$s_!3ccf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78f31367-bb93-4bfc-aa1f-0d4e35cbbc7b_1258x765.png 1272w, https://substackcdn.com/image/fetch/$s_!3ccf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78f31367-bb93-4bfc-aa1f-0d4e35cbbc7b_1258x765.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3ccf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78f31367-bb93-4bfc-aa1f-0d4e35cbbc7b_1258x765.png" width="1258" height="765" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/78f31367-bb93-4bfc-aa1f-0d4e35cbbc7b_1258x765.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:765,&quot;width&quot;:1258,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;red_green&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="red_green" title="red_green" srcset="https://substackcdn.com/image/fetch/$s_!3ccf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78f31367-bb93-4bfc-aa1f-0d4e35cbbc7b_1258x765.png 424w, https://substackcdn.com/image/fetch/$s_!3ccf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78f31367-bb93-4bfc-aa1f-0d4e35cbbc7b_1258x765.png 848w, https://substackcdn.com/image/fetch/$s_!3ccf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78f31367-bb93-4bfc-aa1f-0d4e35cbbc7b_1258x765.png 1272w, https://substackcdn.com/image/fetch/$s_!3ccf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78f31367-bb93-4bfc-aa1f-0d4e35cbbc7b_1258x765.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Examining delays across airlines and airports we saw that the busier the airport or the larger the airline, the higher the percentage of their delayed flights as a part of their total flight count.</p><p>The graphs bellow show all the 14 major American airlines (left) and the hundreds of airports (right) flight delays percentage of their total respective flight counts in all of 2014.</p><p>We can see for example that United Arilines (UA) &#8211; a very big company &#8211; had a much higher percentage of delayed flights than Hawaiin Airlines (HA) &#8211; a much smaller company.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8MOY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4ad0f3a-8943-478e-99b2-c21260a9c6db_800x550.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8MOY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4ad0f3a-8943-478e-99b2-c21260a9c6db_800x550.png 424w, https://substackcdn.com/image/fetch/$s_!8MOY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4ad0f3a-8943-478e-99b2-c21260a9c6db_800x550.png 848w, https://substackcdn.com/image/fetch/$s_!8MOY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4ad0f3a-8943-478e-99b2-c21260a9c6db_800x550.png 1272w, https://substackcdn.com/image/fetch/$s_!8MOY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4ad0f3a-8943-478e-99b2-c21260a9c6db_800x550.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8MOY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4ad0f3a-8943-478e-99b2-c21260a9c6db_800x550.png" width="800" height="550" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c4ad0f3a-8943-478e-99b2-c21260a9c6db_800x550.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:550,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;perf_200&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="perf_200" title="perf_200" srcset="https://substackcdn.com/image/fetch/$s_!8MOY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4ad0f3a-8943-478e-99b2-c21260a9c6db_800x550.png 424w, https://substackcdn.com/image/fetch/$s_!8MOY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4ad0f3a-8943-478e-99b2-c21260a9c6db_800x550.png 848w, https://substackcdn.com/image/fetch/$s_!8MOY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4ad0f3a-8943-478e-99b2-c21260a9c6db_800x550.png 1272w, https://substackcdn.com/image/fetch/$s_!8MOY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4ad0f3a-8943-478e-99b2-c21260a9c6db_800x550.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Next, we combined weather and flight data to see if there is any connection between the two. In the graph bellow, green vertical lines indicate days of storms (rain, snow, strong winds) across 2014 in Atlanta airport. The blue line is the percentage of delayed flights in a day across the same time. We see that during storm times there are no characterizing peaks of delays at the same time.Getting more towards the machine learning phase, after sorting, filtering through and running some basic prediction models, we extracted the following features vector for each flight in 2014:</p><p>&#8220;FlightNum&#8221;,&#8221;CRSDepTime&#8221;,&#8221;DepDelay&#8221;,&#8221;CRSArrTime&#8221;,&#8221;ArrDelay&#8221;,</p><p>&#8220;AirTime&#8221;,&#8221;Distance&#8221;,&#8221;date&#8221;,&#8221;crsdeptime&#8221;,&#8221;crsarrtime&#8221;,&#8221;CLD&#8221;,&#8221;OLD&#8221;,</p><p>&#8220;DLD&#8221;,&#8221;wind_speed&#8221;,&#8221;clouds_height&#8221;,&#8221;temperature&#8221;,&#8221;AU_Intens&#8221;,</p><p>&#8220;AU_Precip&#8221;,&#8221;wind_direction&#8221;,&#8221;visibility&#8221;,&#8221;pressure&#8221;,&#8221;AW_Atmos_Cond&#8221;,</p><p>&#8220;AU_Obscur&#8221;,&#8221;AU_Desc&#8221;,&#8221;Delay&#8221;</p><p>Some of these are categorical parameters, for example, AU_Precip is a value out of 7 possible that describes the type of weather around (specifically, what type of precipitation is going on &#8211; light or heavy rain, snow, no precipitation and more). Some of the parameters were numerical, for example wind_speed which was measured in meters per second.</p><p>All temporal predictive parameters, like weather and conditions the day before were measured the day before each flight. Parameter DepDelay indicated of the time of delay, if it was larger than 15 we considered it as a delayed flight.</p><p>After filtering out all the records to have all these fields we were left with about 2250000 records. We took all records of the last 3 months of 2014 and used them as a test set and the 9 first months as training.</p><p>The three most interesting parameters we found in this feature vector were:</p><ul><li><p>CLD &#8211; <strong>C</strong>arrier F<strong>L</strong>ight <strong>D</strong>elays, a measurement of the amount of delays the same airline had the day before.</p></li><li><p>OLD &#8211; <strong>O</strong>rigin F<strong>L</strong>ight <strong>D</strong>elays, a measurement of the amount of delays the origin airport had the day before.</p></li><li><p>DLD &#8211; <strong>D</strong>estination F<strong>L</strong>ight <strong>D</strong>elays, a measurement of the amount of delays the destination airport had the day before.</p></li></ul><p>We also found that weather information did not help improve prediction accuracy and in some instances even reduced accuracy.</p><p>Our model checked whether we can predict the binary indicator of DepDelay&gt;=15. We used SVM, RandomForest and the simple logistic regression. The best estimation method was the logistic regression and by far the fastest as well. It resulted in the reported 77.6% prediction accuracy.</p><p>The most interesting find we had was that if we can track the physical plane (which is marked by a Tail Number) that will fly, we can achieve a 90%+ predictive power. This is because if a plane is late for his first flight, it will keep being late for the next flights because he has a small amount of time to refuel and continue to the next flight in each destination airport. This chain will only break once the plane had several hours of break in one of its&#8217; destination airport. We tried to predict which tail number is going to be flying the flight, but we found out that it is a task we could not complete within the hackathon time frame. Planes fly to too many destinations and it requires a sophisticated algorithm to predict their location. For example, the airplane in the picture bellow has two main airports it flies to, and from each airport it flies to many other destinations.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GY2x!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a3d1350-6a22-4330-8f74-6870b11df15a_2400x1137.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GY2x!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a3d1350-6a22-4330-8f74-6870b11df15a_2400x1137.png 424w, https://substackcdn.com/image/fetch/$s_!GY2x!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a3d1350-6a22-4330-8f74-6870b11df15a_2400x1137.png 848w, https://substackcdn.com/image/fetch/$s_!GY2x!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a3d1350-6a22-4330-8f74-6870b11df15a_2400x1137.png 1272w, https://substackcdn.com/image/fetch/$s_!GY2x!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a3d1350-6a22-4330-8f74-6870b11df15a_2400x1137.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GY2x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a3d1350-6a22-4330-8f74-6870b11df15a_2400x1137.png" width="2400" height="1137" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a3d1350-6a22-4330-8f74-6870b11df15a_2400x1137.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1137,&quot;width&quot;:2400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;graph&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="graph" title="graph" srcset="https://substackcdn.com/image/fetch/$s_!GY2x!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a3d1350-6a22-4330-8f74-6870b11df15a_2400x1137.png 424w, https://substackcdn.com/image/fetch/$s_!GY2x!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a3d1350-6a22-4330-8f74-6870b11df15a_2400x1137.png 848w, https://substackcdn.com/image/fetch/$s_!GY2x!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a3d1350-6a22-4330-8f74-6870b11df15a_2400x1137.png 1272w, https://substackcdn.com/image/fetch/$s_!GY2x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a3d1350-6a22-4330-8f74-6870b11df15a_2400x1137.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div>]]></content:encoded></item></channel></rss>