<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rupali Roy on Medium]]></title>
        <description><![CDATA[Stories by Rupali Roy on Medium]]></description>
        <link>https://medium.com/@rupali.roy30?source=rss-d2f9ffc25d66------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*IEsaRkV9Rh7_AjVN2ju9DA.jpeg</url>
            <title>Stories by Rupali Roy on Medium</title>
            <link>https://medium.com/@rupali.roy30?source=rss-d2f9ffc25d66------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 20:55:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rupali.roy30/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Bagging vs Boosting: When should you use each?]]></title>
            <link>https://medium.com/@rupali.roy30/boosting-vs-bagging-when-should-you-use-each-52127a6b6bd9?source=rss-d2f9ffc25d66------2</link>
            <guid isPermaLink="false">https://medium.com/p/52127a6b6bd9</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ensemble-method]]></category>
            <category><![CDATA[bagging-vs-boosting]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Rupali Roy]]></dc:creator>
            <pubDate>Sun, 18 Jan 2026 06:35:19 GMT</pubDate>
            <atom:updated>2026-01-20T18:28:37.787Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hkMlQBGvD37S-gz1.jpeg" /><figcaption>Image Source: <a href="https://towardsdatascience.com/wp-content/uploads/2021/01/1zTgGBTQIMlASWm5QuS2UpA.jpeg">https://towardsdatascience.com/wp-content/uploads/2021/01/1zTgGBTQIMlASWm5QuS2UpA.jpeg</a></figcaption></figure><p>Most of us know the difference between boosting and bagging ensemble techniques, but knowing when to use each of these techniques is equally important. In this post, I try to explain what techniques to use when, with examples, and what kind of data is best for each technique.</p><p><strong>Core Idea: { “Bagging”: <em>reduce noise</em>, “Boosting”: <em>reduce mistakes</em> }</strong></p><h3><strong>Bagging</strong></h3><p>In bagging, we train multiple different models independently on different random samples of the data and average their predictions. Because each model sees a slightly different dataset, random noise gets averaged out.</p><p><strong><em>Scenario 1: Model has high variance.</em></strong></p><p>When the model output changes with every small change in data. Training accuracy is more than validation accuracy. Bagging helps by averaging many models to stabilize predictions.</p><p><strong><em>Scenario 2: When the dataset is small/medium.</em></strong></p><p>The model easily overfits as it does not have enough data to learn patterns in the data. Bootstrapping creates multiple datasets, hence reducing variance.</p><p><strong><em>Scenario 3: Data has noise or outliers.</em></strong></p><p>When the data has a lot of noise or is sparse, we want our model to be robust to noise. Since in bagging we create individual models, it won’t all overfit the same noise.</p><p><strong><em>Scenario 4: When we want faster training</em></strong></p><p>In bagging, the models are training parallely and then the predictions are combined, leading to faster training time.</p><p><strong>Example of how bagging handles noisy data:</strong></p><p>Suppose we have data related to emails with a few extreme outliers, emails with length &gt; 100000 labelled as not spam.</p><p>A single decision tree will try to fit the data perfectly by using all the data points. It would create splits just to classify <strong>that one noisy point/outlier. This would result in </strong>overfitting noise, leading to poor generalization. As a result, we will have a model that has h<strong>igh variance and is </strong>unstable.</p><p>How does bagging fix this?</p><p>Step 1: It creates multiple bootstrap samples. Each sample is drawn with replacement, which means each sample has 63% unique points.</p><p>Step 2: Now, since we get each sample with replacement. Not every sample will have the same noisy points, so some trees will encounter them, but many trees will never see them, as each tree is trained on a different sample.</p><p>Step 3: Each tree overfits its own noise (due to different training data), but the noise is different across the trees.</p><p>Step 4: The next step is to take the average of predictions or the highest vote. So noise-driven splits cancel out.</p><h3><strong>Boosting</strong></h3><p><strong>Boosting</strong> train models sequentially, where each new model focuses more on the examples that previous models got wrong. This helps the model to learn hard patterns in the data and improve performance on difficult cases. Boosting works best when the data is cleaner and when you want to improve performance on rare or difficult to predict cases (often datasets that are imbalanced).</p><p><strong><em>Scenario 1: When the model has high bias or is underfitting.</em></strong></p><p>It is really difficult for simple models to capture all the underlying data patterns, which results in having low training and validation accuracy. Boosting helps improve the model&#39;s complexity step by step.</p><p><strong><em>Scenario 2: Handle non-linear interactions in data.</em></strong></p><p>When the data has a lot of complex relationships and weak signals, then sequential learning can help to learn the subtle underlying patterns.</p><p><strong><em>Scenario 3: Imbalanced data</em></strong></p><p>When the data has a rare positive class and model usually predicts the majority class, e.g., fraud detection or disease diagnosis. In Boosting, misclassified data points get more points, and the model eventually learns the rare patterns.</p><p><strong><em>Scenario 4: When accuracy matters more than interpretability</em></strong></p><p>In Kaggle competitions, you will notice that most of the high-performing models are based on the Boosting algorithm. It usually outperforms bagging.</p><p>Example of how <strong>boosting helps with underfitting data</strong></p><p>Suppose we have an example of loan default prediction where default usually happens when the credit score is low, and debt to income ratio is high.</p><p>A single shallow decision tree will try to learn simple rules using all the data. It may learn “low credit score -&gt;default” or “high debt -&gt; default,” but it fails to capture the interaction between features. This results in <strong>underfitting/high bias, leading to low test and train accuracy.</strong></p><p><strong>How does boosting help to fix this?</strong></p><p>Step 1: Train a weak learner that captures a simple pattern (eg, low credit score -&gt;default).</p><p>Step 2: Identify misclassified points (eg, high-debt cases with medium credit scores) and increase their importance.</p><p>Step 3: Train the next weak learner, focusing on these misclassified and hard cases, learning another simple rule (eg, high debt -&gt; default).</p><p>Step 4: Combine learners sequentially so their corrections add up, effectively learning <strong>low credit score and high debt -&gt;default</strong>.</p><p>As a result, boosting helps reduce bias and learns complex patterns that a single model cannot.</p><p>Thank you for reading this post! Comment down and share more interesting scenarios from your experience.</p><p><strong><em>References:</em></strong></p><ol><li><a href="https://www.geeksforgeeks.org/machine-learning/bagging-vs-boosting-in-machine-learning/"><em>https://www.geeksforgeeks.org/machine-learning/bagging-vs-boosting-in-machine-learning/</em></a></li><li><a href="https://www.kaggle.com/code/prashant111/bagging-vs-boosting"><em>https://www.kaggle.com/code/prashant111/bagging-vs-boosting</em></a></li><li><a href="https://towardsdatascience.com/ensemble-learning-bagging-and-boosting-23f9336d3cb0/"><em>https://towardsdatascience.com/ensemble-learning-bagging-and-boosting-23f9336d3cb0/</em></a></li><li><a href="https://www.youtube.com/watch?v=sN5ZcJLDMaE"><em>https://www.youtube.com/watch?v=sN5ZcJLDMaE</em></a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52127a6b6bd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Large Language Models]]></title>
            <link>https://medium.com/@rupali.roy30/introduction-to-large-language-models-434b7b84a3eb?source=rss-d2f9ffc25d66------2</link>
            <guid isPermaLink="false">https://medium.com/p/434b7b84a3eb</guid>
            <dc:creator><![CDATA[Rupali Roy]]></dc:creator>
            <pubDate>Thu, 07 Mar 2024 07:41:20 GMT</pubDate>
            <atom:updated>2024-03-07T07:41:20.387Z</atom:updated>
            <content:encoded><![CDATA[<h3>What are LLMs?</h3><p>Large Language Models (LLMs) are a type of artificial intelligence model that has been trained on vast amounts of textual data to understand and generate human-like language. These models are called “large” because they are composed of billions or even trillions of parameters, which allow them to capture complex patterns, relationships, and nuances in language.</p><p>The breakthrough that enabled the development of LLMs was the Transformer architecture, introduced in 2017. Transformers are a type of neural network that uses self-attention mechanisms to capture long-range dependencies in the input data, making them particularly well-suited for natural language processing tasks.</p><p>Some examples of popular LLMs include:</p><blockquote>1. GPT (Generative Pre-trained Transformer) models, such as GPT-3, developed by OpenAI, can generate human-like text on various topics and tasks.</blockquote><blockquote>2. BERT (Bidirectional Encoder Representations from Transformers), developed by Google, is trained to understand the context of words in a sentence and has been widely used for natural language understanding tasks.</blockquote><blockquote>3. T5 (Text-to-Text Transfer Transformer), developed by Google, can be fine-tuned for various natural language processing tasks, including translation, summarization, and question answering.</blockquote><h3>A brief overview of the Transformer Architecture</h3><p>The Transformer architecture is a type of neural network architecture that has become highly influential in the field of natural language processing (NLP) and beyond. It was introduced in the 2017 paper “<a href="https://arxiv.org/abs/1706.03762">Attention Is All You Need</a>” by researchers at Google Brain.</p><p>The key innovation of the Transformer is its reliance on self-attention mechanisms, which allow the model to capture long-range dependencies and relationships within the input data more effectively than traditional recurrent or convolutional architectures. This makes the Transformer particularly well-suited for tasks that involve processing sequential data, such as natural language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-5FKTPPo6OZLlq_L.png" /><figcaption>The encoder-decoder structure of the Transformer architecture<br>taken from “<a href="https://arxiv.org/abs/1706.03762">Attention Is All You Need</a>“</figcaption></figure><p>The Transformer architecture consists of two main components: the encoder and the decoder.</p><h4>1. Encoder:</h4><p>The encoder is responsible for processing the input sequence. It consists of a stack of identical layers, where each layer contains two sub-layers:</p><p><strong><em>a. Multi-Head Self-Attention Layer: </em></strong>This layer performs self-attention, allowing each position in the input sequence to attend to all other positions. It helps the model capture dependencies and relationships between different parts of the input.</p><p><strong><em>b. Feedforward Neural Network Layer:</em></strong> This layer applies a simple feedforward neural network to the output of the self-attention layer, allowing the model to learn non-linear transformations and capture more complex patterns.</p><h4>2. Decoder:</h4><p>The decoder is responsible for generating the output sequence. Like the encoder, it also consists of a stack of identical layers with two sub-layers:</p><p><strong><em>a. Masked Multi-Head Self-Attention Layer:</em></strong></p><p>This layer performs self-attention similar to the encoder, but it is “masked” to prevent each position from attending to subsequent positions in the output sequence, which is necessary for auto-regressive generation tasks like language modeling or machine translation.</p><p><strong><em>b. Multi-Head Encoder-Decoder Attention Layer:</em></strong></p><p>This layer performs attention over the output of the encoder, allowing the decoder to incorporate information from the input sequence when generating the output.</p><p><strong><em>c. Feedforward Neural Network Layer:</em></strong> Similar to the encoder, this layer applies a feedforward neural network to the output of the attention layers.</p><p>In addition to the self-attention and encoder-decoder attention mechanisms, the Transformer architecture incorporates several other techniques to improve its performance and efficiency, such as:</p><ul><li><strong><em>Positional Encoding: </em></strong>Since the Transformer does not use recurrence or convolutions, it relies on positional encodings to inject information about the position of each token in the sequence.</li><li><strong><em>Residual Connections: </em></strong>These connections help with the flow of gradients during training, enabling the model to learn more effectively.</li><li><strong><em>Layer Normalization: </em></strong>This technique helps stabilize the training process by normalizing the inputs across features.</li></ul><h3>Pretraining techniques</h3><p>Pretraining techniques in NLP involve training models on large amounts of unlabeled text data before fine-tuning them for specific downstream tasks. Two common pretraining techniques are Masked Language Modeling (MLM) and Causal Language Modeling.</p><h4>1. Masked Language Modeling (MLM):</h4><p>In MLM, a certain percentage of words in the input sequence are randomly masked, and the model is trained to predict these masked words based on the context provided by the surrounding words.</p><p>Training Procedure:</p><ol><li>Randomly mask a subset of tokens (words) in the input sequence.</li><li>The model is then trained to predict the original identity of the masked tokens using the information from the unmasked tokens in the sequence.</li></ol><p>3. The loss is calculated based on the model’s predictions compared to the actual masked tokens.</p><blockquote><strong>BERT (Bidirectional Encoder Representations from Transformers): </strong>BERT is a well-known example of a model pretrained using the MLM objective. BERT uses a transformer architecture and has been successful in capturing bidirectional context information, allowing it to understand the meaning of words in context.</blockquote><h4>2. Causal Language Modeling:</h4><p>In causal language modeling, the model is trained to predict the next word in a sequence given the preceding words. This enforces a unidirectional understanding of context, as the model can only consider information from the past (i.e., the words that came before the current position).</p><p>Training Procedure:</p><p>1. Given a sequence of words, the model is trained to predict the next word in the sequence.</p><p>2. The loss is calculated based on the model’s predictions compared to the actual next word in the sequence.</p><blockquote>GPT (Generative Pre-trained Transformer): GPT is an example of a model pretrained using causal language modeling. It uses a transformer architecture and is trained to generate coherent and contextually appropriate text by predicting the next word in a sequence.</blockquote><p>3. Hybrid Approaches:</p><p>Some models combine both MLM and causal language modeling objectives in their pretraining phase. This combination allows the model to capture bidirectional context to some extent while still maintaining a unidirectional causal understanding.</p><blockquote>Examples of models using hybrid approaches include T5 (Text-to-Text Transfer Transformer) and RoBERTa (Robustly optimized BERT approach).</blockquote><p>These pretraining techniques aim to create language representations that capture rich contextual information, enabling the models to understand the semantics and relationships between words in a given text. After pretraining, these models can be fine-tuned on labeled data for specific NLP tasks such as text classification, named entity recognition, and machine translation, among others.</p><h3>Applications and use cases of LLMs</h3><p><strong><em>1. Text Generation:</em></strong> LLMs can generate coherent and contextually relevant text. This is useful for applications such as content creation, creative writing, and chatbot responses.</p><p><strong><em>2. Text Completion and Auto-Generation: </em></strong>They can be used to automatically complete or generate missing parts of a text. This is useful in tasks like auto-completion of sentences, paragraphs, or even code snippets.</p><p><strong><em>3. Text Summarization: </em></strong>It can summarize long pieces of text by extracting the most important information. This is beneficial for creating concise summaries of articles, documents, or news stories.</p><p><strong><em>5. Named Entity Recognition (NER):</em></strong> They can be fine-tuned for NER tasks to identify and classify entities such as names of people, organizations, locations, dates, and more within a given text.</p><p><strong><em>6. Sentiment Analysis:</em></strong> LLMs are effective in understanding and analyzing sentiment in text. They can be fine-tuned for sentiment analysis tasks to determine the sentiment expressed in a piece of text (positive, negative, or neutral).</p><p><strong><em>7. Question Answering: </em></strong>They can comprehend and generate relevant answers to user queries based on the input context.</p><p><strong><em>8. Conversational AI:</em></strong> They can contribute to the development of conversational AI systems, enabling more natural and context-aware interactions between users and virtual assistants or chatbots.</p><p><strong><em>9. Code Generation:</em></strong> LLMs can be used for code completion and generation tasks, assisting developers by suggesting code snippets based on context.</p><p><strong><em>10. Biomedical and Financial Text Analysis:</em></strong> In the healthcare domain, LLMs can be applied to tasks like medical document analysis, information extraction from clinical notes, and biomedical literature mining. They can analyze financial reports, news, and documents to extract valuable insights, aiding in financial decision-making and market analysis.</p><p>The versatility of LLMs stems from their ability to capture complex patterns and relationships in natural language, making them powerful tools for a wide range of NLP applications. Researchers and practitioners continue to explore new ways to leverage these models for solving diverse language-related challenges.</p><p>However, they also come with challenges, such as the potential for generating biased or toxic content, lack of interpretability, and high computational and memory requirements.</p><p>Despite these challenges, LLMs have opened up new frontiers in natural language processing and have the potential to revolutionize how we interact with and utilize language data. As the field continues to advance, research is focused on improving the efficiency, interpretability, and safety of these models, as well as exploring their applications in domains beyond language, such as multimodal tasks involving vision, audio, and other modalities.</p><p>Thanks!</p><p><strong><em>References:</em></strong></p><ol><li><a href="https://jalammar.github.io/illustrated-transformer/">https://jalammar.github.io/illustrated-transformer/</a></li><li><a href="https://arxiv.org/abs/1706.03762">https://arxiv.org/abs/1706.03762</a></li><li><a href="https://towardsdatascience.com/understanding-masked-language-models-mlm-and-causal-language-models-clm-in-nlp-194c15f56a5">https://towardsdatascience.com/understanding-masked-language-models-mlm-and-causal-language-models-clm-in-nlp-194c15f56a5</a></li><li><a href="https://aws.amazon.com/what-is/large-language-model/">https://aws.amazon.com/what-is/large-language-model/</a></li><li><a href="https://www.coursera.org/learn/generative-ai-with-llms">https://www.coursera.org/learn/generative-ai-with-llms</a>?</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=434b7b84a3eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using YOLOv3 for real-time detection of PPE and Fire]]></title>
            <link>https://medium.com/data-science/using-yolov3-for-real-time-detection-of-ppe-and-fire-1c671fcc0f0e?source=rss-d2f9ffc25d66------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c671fcc0f0e</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[object-detection]]></category>
            <category><![CDATA[yolov3]]></category>
            <dc:creator><![CDATA[Rupali Roy]]></dc:creator>
            <pubDate>Tue, 12 May 2020 04:51:50 GMT</pubDate>
            <atom:updated>2020-05-14T05:58:44.580Z</atom:updated>
            <content:encoded><![CDATA[<h4>AI in industrial safety: This article explains how we can use YOLOv3 : an object detection algorithm for real time detection of personal protective equipment(PPE) and Fire</h4><p><em>“Safety is not a gadget but a state of mind!”</em></p><blockquote>The ceaseless climb of the world’s skyscrapers is a story of ever-evolving challenges. We live our daily lives around skyscrapers, malls, and warehouses. Most of the time we are clueless about what it takes to construct these buildings. The construction industry is responsible for creating such magnificent masterpieces. With $1.3 trillion annual expenditure (~6.3% of the GDP) [1] and 7.6 million employees (~5% of the total workforce) [2] as of March 2020, construction is one of the largest sectors of the U.S. economy. However, it is also considered as one of the most hazardous industries due to the high construction site fatalities.</blockquote><p>The top cause of construction related casualties are falls, people getting stuck in the equipment, electrocution and collisions . The majority of these injuries can be prevented if workers wear appropriate personal protective equipment like hard hats, safety vests, gloves, safety goggles, and steel toe boots.To ensure safety at the workplace, the U.S. Occupational Safety and Health Administration (OSHA) requires that contractors enforce and monitor appropriate usage of personal protective equipment (PPE).</p><p>Currently the PPE detection technique can be classified into two types: sensor based and vision based. The sensor based approach uses RFID (Radio Frequency Identification RFID) tags and requires a signiﬁcant investment in purchasing, installing, and maintaining complicated sensor networks. On the contrary, vision-based approaches use cameras to record images or videos of the construction site, which are then analyzed to verify PPE compliance. This approach provides richer information about the scene that can be utilized to understand complex construction sites more promptly, precisely, and comprehensively.</p><p>This article explains how a deep learning model built on YOLOv3 (You Only Look Once) architecture can be used to meet various safety requirements like PPE compliance of construction site workers and fire detection using minimal hardware i.e. a surveillance camera. The deep learning algorithm simultaneously detects individual workers and veriﬁes PPE compliance with a single convolutional neural network (CNN) framework. In today’s world, Convolutional Neural Network (CNN) is most widely used for image classiﬁcation and object detection, due to its ability to self-learn from large sets of annotated training data.</p><h3><strong>Various real time object detection techniques</strong></h3><p>Any object detection problem in computer vision can be defined as identifying an object (a.k.a., classiﬁcation) in an image and then precisely estimating its location(a.k.a., localization) within the image. Object Detection is used almost everywhere these days. The use cases are endless, be it tracking objects, video surveillance, pedestrian detection, anomaly detection, self-driving cars or face detection.</p><p>There are three main object detection algorithms that are currently used in the industry:</p><h4><strong>R-CNN: Region based Convolutional Network</strong></h4><p>An R-CNN ﬁrst identiﬁes several regions of interest, and then uses a CNN to classify those regions to detect objects in them. Since the original R-CNN is slow, faster variants of it, e.g. Fast R-CNN, Faster R-CNN, and Mask R-CNN have been proposed. In R-CNN, the image is first divided into approximately 2000 region recommendations (region propotals) and then CNN (ConvNet) is applied for each region respectively.</p><p>The size of the regions is determined and the correct region is inserted into the artificial neural network. The biggest problem of this method is time. Since each region in the picture is applied CNN separately, training time is approximately 84 hours and forecast time is approximately 47 sec.</p><h4><strong>YOLO: You Only Look Once</strong></h4><p>Most of the object detection algorithms use regions to localize the object within the image. The network does not look at the complete image. Instead, they look at parts of the image which have high probabilities of containing the object. YOLO or You Only Look Once is an object detection algorithm much different from the region based algorithms seen above. In YOLO, a single convolutional network predicts the bounding boxes and the class probabilities for these boxes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JClMisKksSSjzDpz" /><figcaption>A simplified illustration of the YOLO object detector pipeline (<a href="https://arxiv.org/abs/1506.02640"><strong>source</strong></a>)</figcaption></figure><p>The strategy used by YOLO is radically different from earlier detection systems. A single neural network is applied to the whole image. This network splits the picture into regions and calculates bounding boxes for each area and probabilities. Those bounding boxes are weighted by the predicted probabilities.</p><h4><strong>SSD: Single Shot MultiBox Detector</strong></h4><p>SSD<a href="https://arxiv.org/abs/1512.02325"> </a>is a popular algorithm in object detection. It’s generally faster than Faster RCNN. SSD discretizes the output space of bounding boxes into a set of default boxes over different aspect ratios and scales per feature map location. At prediction time, the network generates scores for the presence of each object category in each default box and produces adjustments to the box to better match the object shape. Additionally, the network combines predictions from multiple feature maps with different resolutions to naturally handle objects of various sizes. [4]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/0*E_mxbrAw2SICDROq" /><figcaption>Screenshot from <a href="https://medium.com/analytics-vidhya/beginners-guide-to-object-detection-algorithms-6620fb31c375">article </a>explaining the SSD Architecture</figcaption></figure><p>Now, we will see how we collected data for this project and the implementation of YOLOv3.</p><h3><strong>Data set Collection</strong></h3><p>In this project, we first classified the objects that we are detecting into four categories: Helmet (Person wearing helmet), Person( Person without helmet), Fire and Safety vest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/0*fDgTMyqQvL8GO4ea" /><figcaption>Photo by Author</figcaption></figure><h4><strong>Image Labeling with YOLO format</strong></h4><p>Training data set are images collected as samples and annotated for training deep neural networks. We collected images for our data set from multiple sources like the safety helmet data set that can be found on <a href="https://github.com/njvisionpower/Safety-Helmet-Wearing-Dataset">github</a>, images from google and Flickr and annotating them using labelIMg. Also, for getting custom data with these objects, we used the Flickr API &amp; downloaded the images using <a href="https://github.com/shwetashambhavi/object-classification-with-yolo/blob/master/flickrImageDownloader.ipynb">python</a> code.<strong> </strong>For labelling the image, we used the <a href="https://github.com/tzutalin/labelImg">LabelImg </a>tool.</p><h4><strong>LabelImg Tool</strong></h4><p>LabelImg is a graphical image annotation tool. It is written in Python and uses Qt for its graphical interface. For object detection, there are many formats for preparing and annotating your data set for training. The image annotations are saved as XML files in PASCAL VOC format, the format used by <a href="http://www.image-net.org/">ImageNet</a>. It also supports YOLO format we have used this format and the annotation are saved in below format in a text file.</p><h4><strong>Format in text file</strong></h4><p>&lt;object-class&gt; &lt;x&gt; &lt;y&gt; &lt;width&gt; &lt;height&gt;</p><p>&lt;x&gt; / &lt;y&gt; corresponds to the centre in the corresponding axis of the bounding box</p><p>&lt;width&gt;/ &lt;height&gt; corresponds to the width &amp; height of the bounding box</p><p>&lt;x&gt; &lt;y&gt; &lt;width&gt; &lt;height&gt; ; ranges from [0; 1]</p><p><strong>Example:</strong></p><p>2 0.513125 0.209167 0.173750 0.358333</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zb_TmgOY0zhU-rQ_" /><figcaption>Photo by Author</figcaption></figure><p>You can refer to this article <a href="https://medium.com/deepquestai/object-detection-training-preparing-your-custom-dataset-6248679f0d1d"><em>https://medium.com/deepquestai/object-detection-training-preparing-your-custom-dataset-6248679f0d1d</em></a><em> </em>to get a comprehensive overview of how to use this tool for annotating your custom data set.</p><h4>Important note while labeling</h4><p>To avoid false predictions while collecting the data for fire images, we made sure that we include various orientations, backgrounds and angles of every object to train our model better. For example, we have included images of setting sun will null annotation to avoid it being misidentified as fire.</p><p>Here is a <a href="https://github.com/rroy1212/PPE_Detection_YOLOv3/blob/master/dataset">link </a>for our data set that contains images for a person with helmet, a person without helmet, fire and safety vest.</p><h3><strong>Why use YOLO?</strong></h3><p>One of the biggest advantages of using YOLO over other detection systems is that its predictions are informed by the global context of the entire image at the time of testing. It also makes predictions with a single-network evaluation, unlike classifier based systems such as the R-CNN. YOLO works more than 1000x faster than R-CNN and over a 100x faster than Fast R-CNN. [10]</p><ul><li>Speed (45 frames per second — better than realtime)</li><li>Network understands generalized object representation (This allowed them to train the network on real world images and predictions on artwork was still fairly accurate)</li><li>Faster version (with smaller architecture) — 155 frames per sec but is less accurate</li><li>Open Source: <a href="https://pjreddie.com/darknet/yolo/">https://pjreddie.com/darknet/yolo/</a></li></ul><h3><strong>Different Version of YOLO</strong></h3><p>The version we have used for our project is YOLOv3. YOLO currently has 4 versions: v1, v2, v3 and v4. There have been incremental improvements to each version. The most notable improvements in v3, that we have used, are in class prediction and feature extraction. For class prediction, YOLOv3 does not use softmax as it assumes that each “box” can only have one class, which is not often true. Instead, the researchers used independent logistic classifiers. For feature extraction, they use a network with 53 convolutional layers — called Darknet-53.[11]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aQ8dMs4IFr0Ayegs" /><figcaption>Speed/accuracy tradeoff on the mAP at .5 IOU metric refer <a href="https://pjreddie.com/darknet/yolo/">website</a></figcaption></figure><h3>Different Implementation of YOLO</h3><ol><li>Darknet (<a href="https://pjreddie.com/darknet/">https://pjreddie.com/darknet/</a>)</li><li>AlexeyAB/darknet (<a href="https://github.com/AlexeyAB/darknet">https://github.com/AlexeyAB/darknet</a>)</li><li>Darkflow (<a href="https://github.com/thtrieu/darkflow/">https://github.com/thtrieu/darkflow/</a>)</li></ol><p>We are using Darknet implementation of YOLO</p><h3><strong>How YOLOv3 works?</strong></h3><p>Please refer to the paper on “<a href="https://www.sciencedirect.com/science/article/abs/pii/S0926580519308325#!">Deep learning for site safety: Real-time detection of personal protective equipment</a>” to better understand the YOLOv3 working.</p><ol><li>In YOLO-v3 we take a 416 × 416 RGB image as input and that contains three output layers, each dividing the input image into 13 × 13 grids (Output-1), 26 × 26 grids (Output-2), and 52 × 52 grids (Output-3), respectively as shown in image below. [12]</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*0kBGCs7aNibSd4_KXc_Ykg.png" /><figcaption>YOLOv3 algortihm as explained in “<a href="https://www.sciencedirect.com/science/article/abs/pii/S0926580519308325#!">Deep learning for site safety: Real-time detection of personal protective equipment</a>”</figcaption></figure><p>2. Three anchor boxes are connected to each of the three output layers, resulting in a total of nine anchor boxes.[12]</p><p>3. The output-1 layer refers to the three biggest anchor boxes (to detect large objects), the output-2 layer is attached to the next three biggest anchor boxes (to detect medium sized objects), and the Output-3 layer is associated with the three smallest anchor boxes (to detect small objects).[12]</p><p>4. In the training process, each grid cell in the output layers takes appropriate anchor boxes and learns how to move and/or scale these anchor boxes in such a way that the changed boxes (a.k.a., bounding boxes) perfectly ﬁt the objects of interest, as illustrated in Fig..[12]</p><p>5. Each predicted bounding box is associated with a (N +5)-dimensional vector.[12]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/0*Lp6qO58EmACHY8Do" /></figure><p>In the above vector tx, ty, tw and th represent x- and y-coordinates of the center, and the width and height of the box, respectively.</p><p>6. The value p0 (a.k.a., objectness score) is the probability of the subject/object within the boundary frame. The remaining values are N conditional probabilities, P(Ci|object), each indicating that given an object present inside the box what is the probability that it belongs to class Ci, where i = 1,…, N.[12]</p><p>7. In total, YOLO-v3 results in a total of 10,647 boxes for a single image since (13 ×13 × 3) +(26 ×26 × 3)+ (52 ×52 ×3) = 10,647. Intuitively however, most of these output boxes in the input picture are either false positives or represent the same thing.[12]</p><p>8. To avoid inconsistency and replication in the inference part, YOLO uses the non-maximum suppression (NMS) technique to eliminate boxes with higher percentage of overlapping but with lower confidence levels, thus ensuring the preservation of a single bounding box for a given item.[12]</p><h3>Quantitative Analysis of Results</h3><p>A common metric to measure the performance of object detection algorithm is intersection over union(a.k.a. IoU). As shown in image below, IoU represents the percentage of overlap between two boxes, e.g., the ground-truth box (G) and the predicted box (P), and is calculated using equation given below:[12]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*ILArQ3pT0og8RqZd4-PWCQ.png" /><figcaption>Calculating IoU</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*06tuYUzTp15oe-p705Atrw.png" /></figure><p>In the image shown below we can see that the bounding box in white represents the ground truth and the bounding box in red represents prediction. The difference in the ground truth and prediction is used to get the mean average precision for our model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*OhaSI8lddetn0UZWrp_X2Q.png" /><figcaption>Image by Author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*rt9cg70eCCSHL9XqEQv_rQ.png" /><figcaption>Image by Author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y0zL4124jG9E0afVCFMG8A.png" /><figcaption>Image by Author</figcaption></figure><p>AP (Average precision) is the most widely used metric in measuring the accuracy of object detectors like Faster R-CNN, SSD, YOLOv3 etc. Average precision computes the average precision value for recall value over 0 to 1.</p><p>Below image shows our prediction results on our entire data set. We have obtained Mean Average precision of 77.58%</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a9ZarvAFP1fyMcoy7ZKFBA.png" /><figcaption>Image by Author</figcaption></figure><p>We tested our trained model on a video that has people wearing helmets, safety vest and there is also a scene with fire in it.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmoP94cmI_RI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DmoP94cmI_RI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FmoP94cmI_RI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a87b39975749757a033aa9f4375029e/href">https://medium.com/media/1a87b39975749757a033aa9f4375029e/href</a></iframe><p>If you are interested in the code for the implementation of YOLOv3 on our custom data set, please use the below link to access it.</p><p><a href="https://github.com/rroy1212/PPE_Detection_YOLOv3/blob/master/PPE_and_Fire_Detection.ipynb">rroy1212/PPE_Detection_YOLOv3</a></p><h3><strong>Video Explanation of our Project</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FoOQdiCRa6VE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DoOQdiCRa6VE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FoOQdiCRa6VE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b93cd51dd1cd27c250bcf12c39d0f2c4/href">https://medium.com/media/b93cd51dd1cd27c250bcf12c39d0f2c4/href</a></iframe><h3>Contributors</h3><blockquote>A project by Aastha Goyal, Harshit Nainwani, Rishi Dhaka, Rupali Roy and Shweta Shambhavi for the Data Science Laboratory course EE 460J at UT Austin. Special thanks to Prof Alex Dimakis!</blockquote><h3>References</h3><ol><li>United States Census Bureau, Construction spending, <a href="https://www.census.gov/">https://www.census.gov/ construction/c30/prpdf.html</a> , Accessed date: 11 May 2020.</li><li>Bureau of Labor Statistics, Industries at a glance: construction, <a href="https://www.bls./">https://www.bls. gov/iag/tgs/iag23.htm</a> , Accessed date: 11 May 2020.</li><li>https://towardsdatascience.com/r-cnn-fast-r-cnn-faster-r-cnn-yolo-object-detection-algorithms-36d53571365e</li><li><a href="https://arxiv.org/abs/1512.02325">https://arxiv.org/abs/1512.02325</a></li><li><a href="https://www.sciencedirect.com/science/article/abs/pii/S0926580519308325?via%3Dihub">https://www.sciencedirect.com/science/article/abs/pii/S0926580519308325?via%3Dihub</a></li><li><a href="https://medium.com/@jonathan_hui/map-mean-average-precision-for-object-detection-45c121a31173">https://medium.com/@jonathan_hui/map-mean-average-precision-for-object-detection-45c121a31173</a></li><li>T.-Y. Lin, P. Goyal, R. Girshick, K. He, and P. Dollar. Focal loss for dense object detection. arXiv preprintarXiv:1708.02002, 2017</li><li><a href="https://arxiv.org/abs/1506.02640">https://arxiv.org/abs/1506.02640</a></li><li><a href="https://medium.com/analytics-vidhya/beginners-guide-to-object-detection-algorithms-6620fb31c375">https://medium.com/analytics-vidhya/beginners-guide-to-object-detection-algorithms-6620fb31c375</a></li><li><a href="https://towardsdatascience.com/yolo-you-only-look-once-real-time-object-detection-explained-492dc9230006">https://towardsdatascience.com/yolo-you-only-look-once-real-time-object-detection-explained-492dc9230006</a></li><li><a href="https://arxiv.org/pdf/1804.02767.pdf">J. Redmon, A. Farhadi. YOLOv3: An Incremental Improvement, 2018. arXiv</a></li><li>Nath, Nipun D., Amir H. Behzadan, and Stephanie G. Paal on “<a href="https://www.sciencedirect.com/science/article/abs/pii/S0926580519308325#!">Deep learning for site safety: Real-time detection of personal protective equipment</a>” <em>Automation in Construction</em> 112 (2020): 103085</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c671fcc0f0e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/using-yolov3-for-real-time-detection-of-ppe-and-fire-1c671fcc0f0e">Using YOLOv3 for real-time detection of PPE and Fire</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hiding data in an image : Image Steganography using Python]]></title>
            <link>https://medium.com/data-science/hiding-data-in-an-image-image-steganography-using-python-e491b68b1372?source=rss-d2f9ffc25d66------2</link>
            <guid isPermaLink="false">https://medium.com/p/e491b68b1372</guid>
            <category><![CDATA[data-encryption]]></category>
            <category><![CDATA[steganography]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-security]]></category>
            <dc:creator><![CDATA[Rupali Roy]]></dc:creator>
            <pubDate>Thu, 07 May 2020 11:21:18 GMT</pubDate>
            <atom:updated>2020-05-08T01:20:19.305Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XVhiMOhxBKmqHzMslQrwaw.png" /><figcaption>Image Source <a href="https://blogs.umass.edu/Techbytes/2018/10/30/hiding-in-plain-sight-with-steganography/">UMassAherst</a> Article</figcaption></figure><h3>Image Steganography using Python</h3><h4>Understanding LSB Image Steganography and implementing it using Python!</h4><blockquote>Today the world is witnessing a data explosion like never before. The amount of data we produce every day is truly mind-boggling. The Forbes article <strong>“How Much Data Do We Create Every Day?”</strong> states that there are about <a href="https://www.domo.com/learn/data-never-sleeps-5?aid=ogsm072517_1&amp;sf100871281=1">2.5 quintillion bytes of data</a> created each day at our current pace, but that pace is only accelerating with the growth of the Internet of Things (IoT). Over the last two years alone 90 percent of the data in the world was generated. This is worth re-reading!</blockquote><p>Data. In essence, the modern computing world revolves around this word. But just what is so intriguing about it? In today’s world, businesses have started realizing that data is power as it can potentially predict customer trends, increase sales, and push the organization to newer heights. With the fast pace advancement in technology and use of data for continuous innovation it has become our topmost priority to secure data. Data sharing is increasing as thousands of messages and data are being transmitted on the internet everyday from one place to another. The protection of data is the primary concern of the sender and it is really important that we encrypt our message in a secret way that only the receiver is able to understand.</p><p>In this article we will understand what is least significant bit steganography and how can we implement it using python.</p><h3><strong>What is Steganography?</strong></h3><p>Steganography is the process of hiding a secret message within a larger one in such a way that someone can not know the presence or contents of the hidden message. The purpose of Steganography is to maintain secret communication between two parties. Unlike cryptography, which conceals the contents of a secret message, steganography conceals the very fact that a message is communicated. Although steganography differs from cryptography, there are many analogies between the two, and some authors classify steganography as a form of cryptography since hidden communication is a type of secret message.</p><h3><strong>Advantage of using Steganography over Cryptography?</strong></h3><p>Up to now, cryptography has always had its ultimate role in protecting the secrecy between the sender and the intended receiver. However, nowadays steganography techniques are used increasingly besides cryptography to add more protective layers to the hidden data. The advantage of using steganography over <a href="https://en.wikipedia.org/wiki/Cryptography">cryptography</a> alone is that the intended secret message does not attract attention to itself as an object of scrutiny. Plainly visible encrypted messages, no matter how unbreakable they are, arouse interest and may in themselves be incriminating in countries in which <a href="https://en.wikipedia.org/wiki/Encryption">encryption</a> is illegal. [1]</p><h3><strong>Types of Steganography</strong></h3><p>Steganography works have been carried out on different transmission media like images, video, text, or audio.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/0*0PvWnJdRtDMkh8JS" /><figcaption>Image by author</figcaption></figure><h3><strong>Basic Steganographic Model</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/0*fwfkaK09mCKlWrJc" /><figcaption>Screenshot from Edureka <a href="https://www.edureka.co/blog/steganography-tutorial">Steganography</a> Tutorial</figcaption></figure><p>As seen in the above image, both the original image file(X) and secret message (M) that needs to be hidden are fed into a steganographic encoder as input. Steganographic Encoder function, f(X,M,K) embeds the secret message into a cover image file by using techniques like least significant bit encoding. The resulting stego image looks very similar to your cover image file, with no visible changes. This completes encoding. To retrieve the secret message, stego object is fed into Steganographic Decoder.[3]</p><p>This article will help you to implement image steganography using Python. It will help you write a Python code to hide text messages using a technique called <a href="https://www.sciencedirect.com/topics/computer-science/least-significant-bit">Least Significant Bit</a>.</p><h3><strong>Least Significant Bit Steganography</strong></h3><p>We can describe a <strong>digital image</strong> as a finite set of digital values, called pixels. Pixels are the smallest individual element of an image, holding values that represent the brightness of a given color at any specific point. So we can think of an image as a matrix (or a two-dimensional array) of pixels which contains a fixed number of rows and columns.</p><p>Least Significant Bit (LSB) is a technique in which the last bit of each pixel is modified and replaced with the secret message’s data bit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/0*yARnljvGACzlItk-" /><figcaption>Photo credits to Edureka <a href="https://www.edureka.co/blog/steganography-tutorial">Steganography</a> tutorial</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/0*z2XIiLwo7ZKGsWhw" /><figcaption>Photo by Edureka <a href="https://www.edureka.co/blog/steganography-tutorial">Steganography</a> tutorial</figcaption></figure><p>From the above image it is clear that, if we change MSB it will have a larger impact on the final value but if we change the LSB the impact on the final value is minimal, thus we use least significant bit steganography.</p><h4><strong>How LSB technique works?</strong></h4><p>Each pixel contains three values which are Red, Green, Blue, these values range from <strong>0 to 255</strong>, in other words, they are 8-bit values. [4] Let’s take an example of how this technique works, suppose you want to hide the message “<strong>hi</strong>” into a <strong>4x4</strong> image which has the following pixel values:</p><p><strong>[(225, 12, 99), (155, 2, 50), (99, 51, 15), (15, 55, 22),(155, 61, 87), (63, 30, 17), (1, 55, 19), (99, 81, 66),(219, 77, 91), (69, 39, 50), (18, 200, 33), (25, 54, 190)]</strong></p><p>Using <a href="http://www.asciitable.com/">the ASCII Table</a>, we can convert the secret message into decimal values and then into binary: <strong>0110100 0110101.</strong>Now, we iterate over the pixel values one by one, after converting them to binary, we replace each least significant bit with that message bits sequentially (e.g 225 is 11100001, we replace the last bit, the bit in the right (1) with the first data bit (0) and so on).This will only modify the pixel values by +1 or -1 which is not noticeable at all. The resulting pixel values after performing LSBS is as shown below:</p><p><strong>[(224, 13, 99),(154, 3, 50),(98, 50, 15),(15, 54, 23),(154, 61, 87),(63, 30, 17),(1, 55, 19),(99, 81, 66),(219, 77, 91),(69, 39, 50),(18, 200, 33),(25, 54, 190)]</strong></p><h3><strong>Hiding text inside an image using Python</strong></h3><p>In this section, we can find a step-by-step of the hide and reveal process using Python code. Open a <a href="https://colab.research.google.com/notebooks/intro.ipynb">google collab notebook</a> and follow the steps below:</p><p>Before beginning with the code, you can upload the image(png) that you would like to use for steganography using the upload option that appears on the left hand side menu bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u4pEeA_Tn_DabtLw" /><figcaption>Photo by Author</figcaption></figure><p><strong>Step 1:</strong> Import all the required python libraries</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x6ZXcEMtaIVBxVnb" /></figure><p><strong>Step 2: </strong>Define a function to convert any type of data into binary, we will use this to convert the secret data and pixel values to binary in the encoding and decoding phase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/0*zbUTZXC8YJtG03Xj" /></figure><p><strong>Step 3:</strong> Write a function to hide secret message into the image by altering the LSB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q_WPjVi7d8wkUv7q" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/0*A4bFf0fgsbL0rgE7" /></figure><p><strong>Step 4: </strong>Define a function to decode the hidden message from the stego image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qEpT5_0vFVIheamk" /></figure><p><strong>Step 5:</strong> Function that takes the input image name and secret message as input from user and calls hideData() to encode the message</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H7imEfeyiFbx0T7i" /></figure><p><strong>Step 6: </strong>Create a function to ask user to enter the name of the image that needs to be decoded and call the showData() function to return the decoded message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DoZEkmVLp_eo4_4c" /></figure><p><strong>Step 7: </strong>Main Function()</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G6Z_yK4I9tIzCVOt" /></figure><p><strong>Output/Results:</strong></p><p>Encoding the message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/0*_xinlcljWazWX0DE" /></figure><p>Decoding the message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hy8TeB8TMmE68gCN" /></figure><p>If you are interested in the code, you can find my notebook on <a href="https://github.com/rroy1212/Image_Steganography/blob/master/ImageSteganography.ipynb">Github</a>.</p><h3>References:</h3><ol><li><a href="https://towardsdatascience.com/steganography-hiding-an-image-inside-another-77ca66b2acb1">https://towardsdatascience.com/steganography-hiding-an-image-inside-another-77ca66b2acb1</a></li><li><a href="https://www.edureka.co/blog/steganography-tutorial">https://www.edureka.co/blog/steganography-tutorial</a></li><li><a href="https://www.forbes.com/sites/bernardmarr/2018/05/21/how-much-data-do-we-create-every-day-the-mind-blowing-stats-everyone-should-read/#191d0b0160ba">https://www.forbes.com/sites/bernardmarr/2018/05/21/how-much-data-do-we-create-every-day-the-mind-blowing-stats-everyone-should-read/#191d0b0160ba</a></li><li><a href="https://www.ukessays.com/essays/computer-science/steganography-uses-methods-tools-3250.php">https://www.ukessays.com/essays/computer-science/steganography-uses-methods-tools-3250.php</a></li><li><a href="https://www.thepythoncode.com/article/hide-secret-data-in-images-using-steganography-python">https://www.thepythoncode.com/article/hide-secret-data-in-images-using-steganography-python</a></li><li><a href="https://www.youtube.com/watch?v=xepNoHgNj0w&amp;t=1922s">https://www.youtube.com/watch?v=xepNoHgNj0w&amp;t=1922s</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e491b68b1372" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/hiding-data-in-an-image-image-steganography-using-python-e491b68b1372">Hiding data in an image : Image Steganography using Python</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the difference between AI, ML and DL!!]]></title>
            <link>https://medium.com/data-science/understanding-the-difference-between-ai-ml-and-dl-cceb63252a6c?source=rss-d2f9ffc25d66------2</link>
            <guid isPermaLink="false">https://medium.com/p/cceb63252a6c</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Rupali Roy]]></dc:creator>
            <pubDate>Wed, 29 Apr 2020 09:39:51 GMT</pubDate>
            <atom:updated>2020-05-01T19:14:12.463Z</atom:updated>
            <content:encoded><![CDATA[<h3>AI, ML, and DL: How not to get them mixed!</h3><h4>Understanding difference between Artificial Intelligence, Machine Learning and Deep Learning</h4><blockquote>I am pretty sure most of us might be familiar with the term “ Artificial Intelligence”, as it has been a major focus in some of the famous Hollywood movies like “The Matrix”, “The Terminator” , “Interstellar”. Although Hollywood films and science fiction novels portray AI as human-like robots taking over the planet, the actual evolution of AI technologies is not even that smart or that frightening. Instead AI has grown to offer many different benefits across industries like healthcare, retail, manufacturing, banking and many more.</blockquote><p>Artificial Intelligence, Machine Learning, Deep Learning, Data Science are popular terms in this era. And knowing what it is and the difference between them is more crucial than ever. Although these terms might be closely related there are differences between them see the image below to visualize it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/0*5NrDYk8PryKASFJD" /><figcaption>Photo by Author</figcaption></figure><h3><strong>What is Artificial Intelligence?</strong></h3><p>Humans have long been obsessed with creating AI ever since the question, “Can machines think?”, was posed by Alan Turing in 1950. AI enables the machine to think, that is without any human intervention the machine will be able to take its own decision. It is a broad area of computer science that makes machines seem like they have human intelligence. So it’s not only programming a computer to drive a car by obeying traffic signals but it’s when that program also learns to exhibit the signs of human-like road rage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/0*fSkLjBySmQL84D_i" /><figcaption>Image from Artificial Intelligence <a href="https://www.youtube.com/watch?v=mJeNghZXtMo&amp;t=173s">HubSpot</a></figcaption></figure><h3>Types of Artificial Intelligence System</h3><p>AI systems are classified by their ability to imitate human behaviors, the hardware they use to do so, their applications in the real world and the theory of mind. Using these features for comparison, all systems of artificial intelligence actual and hypothetical fall into one of three types:</p><h4><strong>ANI: Artificial Narrow Intelligence</strong></h4><p>Artificial Narrow intelligence is also known as weak AI and it is the only type of AI that exists in our world today. Narrow AI is goal oriented and is programmed to perform a single task and is very intelligent in completing the specific task that it is programmed to do. Some examples of ANI are Siri, Auto pilot in an airplane, chat bots, self driving cars etc.</p><p>Narrow AI systems are not conscious, sentient or driven by emotions as humans are, they use information from a specific dataset and do not perform any task that is outside of the single task that they are designed to perform.</p><h4><strong>AGI: Artificial General Intelligence</strong></h4><p>Artificial General Intelligence also referred to as strong AI is a concept in which machines exhibit human intelligence. In this the machines have the ability to learn, understand and act in a way that is indistinguishable from a human in a given situation. The General AI does not currently exist but has been used in many sci-fi hollywood movies in which the humans interact with machines that are conscious, driven by emotions and self-aware.</p><p>Using strong AI we can have the ability to build machines that can think, strategize and perform multiple tasks under uncertain conditions. They can integrate their prior knowledge in decision making to come up with innovative, creative and unconventional solutions.</p><h4><strong>ASI: Artificial Super Intelligence</strong></h4><p>I am sure you remember Arnold Schwarzenegger’s “The Terminator” where a machines cognizance superseded human intelligence in all aspects. Artificial Super Intelligence is a hypothetical AI where machines will be capable of exhibiting intelligence that surpasses that of the brightest humans. In this type of AI, apart from having multifaceted intelligence of human beings machines will have greater problem solving and decision making capabilities that will be far superior than human beings. It is the type of AI that will have great impact on humanity and may lead to extinction of the human race from the planet.</p><h3><strong>What is Machine Learning?</strong></h3><p>Machine Learning is a subset of Artificial Intelligence that uses statistical learning algorithms to build systems that have the ability to automatically learn and improve from experiences without being explicitly programmed.</p><p>Most of us use machine learning in our day to day life when we use services like recommendation systems on Netflix, Youtube, Spotify; search engines like google and yahoo; voice assistants like google home and amazon alexa. In Machine Learning we train the algorithm by providing it with a lot of data and allowing it to learn more about the processed information.</p><p>ML algorithms can be broadly classified into three categories Supervised, Unsupervised and Reinforcement learning.</p><h4><strong>Supervised Learning</strong></h4><p>In supervised learning we have input variables (x) and an output variable (Y) and we use an algorithm to learn the mapping from input to output. In other words, a supervised learning algorithm takes a known set of input dataset and its known responses to the data (output) to learn the regression/classification model. A learning algorithm then trains a model to generate a prediction for the response to new data or the test datasets.</p><h4><strong>Unsupervised Learning</strong></h4><p>Unsupervised Learning is used when we do not have labelled data. Its main focus is to learn more about the data by inferring patterns in the dataset without reference to the known outputs. It is called unsupervised because the algorithms are left on their own to group the unsorted information by finding similarities, differences and patterns in the data. Unsupervised learning is mostly performed as a part of exploratory data analysis. It is most commonly used to find clusters of data and for dimensionality reduction.</p><h4><strong>Reinforcement Learning</strong></h4><p>In simple terms, reinforcement learning can be explained as learning by continuously interacting with the environment. It is a type of machine learning algorithm in which an agent learns from an interactive environment in a trial and error way by continuously using feedback from its previous actions and experiences. The reinforcement learning uses rewards and punishments, the agents receive rewards for performing correct actions and penalties for doing it incorrectly.</p><h3><strong>What is Deep Learning?</strong></h3><p>Deep learning is a machine learning technique that is inspired by the way a human brain filters information, it is basically learning from examples. It helps a computer model to filter the input data through layers to predict and classify information. Since deep learning processes information in a similar manner as a human brain does, it is mostly used in applications that people generally do. It is the key technology behind driver-less cars, that enables them to recognize a stop sign and to distinguish between a pedestrian and lamp post. Most of the deep learning methods use neural network architectures, so they are often referred to as deep neural networks.</p><p>Deep Learning is basically mimicking the human brain, it can also be defined as a multi neural network architecture containing a large number of parameters and layers. The three fundamental network architectures are as listed below:</p><h4><strong>Convolutional Neural Networks</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fVtViBt3a3UVx3Q4" /><figcaption>Image from MDPI <a href="https://www.mdpi.com/1099-4300/19/6/242">article</a> <em>Entropy</em> 19.6 (2017): 242</figcaption></figure><p>Convolutional Neural Network is basically an artificial neural network that is most widely used in the field of Computer Vision for analyzing and classifying images. It is a deep learning algorithm that takes the input image and assigns weights/biases to various aspects or objects in the image, so that it can differentiate one from the other. The hidden layers of a CNN typically consist of convolutional layers, pooling layers, fully connected layers, and normalization layers. The architecture of a ConvNet is analogous to that of the connectivity pattern of Neurons in the Human Brain and was inspired by the organization of the Visual Cortex.</p><h4><strong>Recurrent Neural Networks</strong></h4><p>Recurrent Neural Networks is a type of neural network architecture that is used in sequence prediction problems and is heavily used in the field of Natural Language Processing. RNNs are called <em>recurrent</em> because they perform the same task for every element of a sequence, with the output being dependent on the previous computations. Another way to think about RNNs is that they have a “memory” which captures information about what has been calculated so far.</p><p>To understand more about RNN please refer this article</p><p><a href="http://www.wildml.com/2015/09/recurrent-neural-networks-tutorial-part-1-introduction-to-rnns/"><em>http://www.wildml.com/2015/09/recurrent-neural-networks-tutorial-part-1-introduction-to-rnns/</em></a></p><h4><strong>Recursive Neural Networks</strong></h4><p>“<em>A </em><strong><em>recursive neural network</em></strong><em> is a kind of </em><a href="https://en.wikipedia.org/wiki/Deep_learning#Deep_neural_networks"><em>deep neural network</em></a><em> created by applying the same set of weights </em><a href="https://en.wikipedia.org/wiki/Recursion"><em>recursively</em></a><em> over a structured input, to produce a </em><a href="https://en.wikipedia.org/wiki/Structured_prediction"><em>structured prediction</em></a><em> over variable-size input structures, or a scalar prediction on it, by traversing a given structure in </em><a href="https://en.wikipedia.org/wiki/Topological_sort"><em>topological order</em></a><em>.” [9]</em></p><p>A recursive neural network is more like a hierarchical network where there is really no time aspect to the input sequence but the input has to be processed hierarchically in a tree fashion. Here is an example of how a recursive neural network looks. It shows the way to learn a parse tree of a sentence by recursively taking the output of the operation performed on a smaller chunk of the text.</p><figure><img alt="PyTorch — Recursive Neural Networks — Tutorialspoint" src="https://cdn-images-1.medium.com/max/602/0*1A9ZuxPV5N5jfDXE" /><figcaption>Screenshot from <a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fwww.tutorialspoint.com%2Fpytorch%2Fpytorch_recursive_neural_networks.htm&amp;psig=AOvVaw1Xqy30OWN5TmfZmBgzs_wf&amp;ust=1588290731429000&amp;source=images&amp;cd=vfe&amp;ved=0CA0QjhxqFwoTCMjkk5nqjukCFQAAAAAdAAAAABAD">PyTorch — Recursive Neural Networks — Tutorialspoint</a></figcaption></figure><p><em>This article tries to explain the differences between Artificial Intelligence, Machine Learning and Deep Learning, by defining them and explaining the various subcategories within each topic. To get a deeper understanding of the above mentioned topics please refer to the articles mentioned in the references section.</em></p><h4><strong><em>References</em></strong></h4><ol><li><a href="http://beamandrew.github.io/deeplearning/2017/02/23/deep_learning_101_part1.html">http://beamandrew.github.io/deeplearning/2017/02/23/deep_learning_101_part1.html</a></li><li><a href="https://contentsimplicity.com/what-is-deep-learning-and-how-does-it-work/">https://contentsimplicity.com/what-is-deep-learning-and-how-does-it-work/</a></li><li><a href="https://towardsdatascience.com/what-are-the-types-of-machine-learning-e2b9e5d1756f">https://towardsdatascience.com/what-are-the-types-of-machine-learning-e2b9e5d1756f</a></li><li><a href="https://codebots.com/artificial-intelligence/the-3-types-of-ai-is-the-third-even-possible">https://codebots.com/artificial-intelligence/the-3-types-of-ai-is-the-third-even-possible</a></li><li><a href="https://www.sciencedirect.com/topics/computer-science/supervised-learning">https://www.sciencedirect.com/topics/computer-science/supervised-learning</a></li><li><a href="https://medium.com/@tjajal/distinguishing-between-narrow-ai-general-ai-and-super-ai-a4bc44172e22">https://medium.com/@tjajal/distinguishing-between-narrow-ai-general-ai-and-super-ai-a4bc44172e22</a></li><li><a href="https://towardsdatascience.com/understanding-neural-networks-from-neuron-to-rnn-cnn-and-deep-learning-cd88e90e0a90">https://towardsdatascience.com/understanding-neural-networks-from-neuron-to-rnn-cnn-and-deep-learning-cd88e90e0a90</a></li><li><a href="https://en.wikipedia.org/wiki/Recursive_neural_network">https://en.wikipedia.org/wiki/Recursive_neural_network</a></li><li><a href="https://www.youtube.com/watch?v=k2P_pHQDlp0&amp;t=404s">https://www.youtube.com/watch?v=k2P_pHQDlp0&amp;t=404s</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cceb63252a6c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/understanding-the-difference-between-ai-ml-and-dl-cceb63252a6c">Understanding the difference between AI, ML and DL!!</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>