<?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 Allagui Mohamed Hamza on Medium]]></title>
        <description><![CDATA[Stories by Allagui Mohamed Hamza on Medium]]></description>
        <link>https://medium.com/@hamzaallagui510?source=rss-601434822c56------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pVhKyi0c5MsjC9ZASVfbIA.jpeg</url>
            <title>Stories by Allagui Mohamed Hamza on Medium</title>
            <link>https://medium.com/@hamzaallagui510?source=rss-601434822c56------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 02:44:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hamzaallagui510/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[Federated Learning: Bridging AI Innovation and Data Privacy]]></title>
            <link>https://medium.com/@hamzaallagui510/federated-learning-bridging-ai-innovation-and-data-privacy-927202b4ccc7?source=rss-601434822c56------2</link>
            <guid isPermaLink="false">https://medium.com/p/927202b4ccc7</guid>
            <category><![CDATA[model-training]]></category>
            <category><![CDATA[federated-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Allagui Mohamed Hamza]]></dc:creator>
            <pubDate>Sun, 01 Dec 2024 01:51:35 GMT</pubDate>
            <atom:updated>2024-12-01T01:51:35.623Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V2nzeVvZmEEN0Hnx.png" /></figure><h3>1. Introduction</h3><p>With the rapid innovation and growth of technology, artificial intelligence (AI) faces numerous challenges. Practitioners and researchers work tirelessly to address these challenges, contributing to global technological progress. Among these challenges, data privacy stands out as a major concern. Many data stakeholders or owners are reluctant to share their data with AI practitioners to maintain security and confidentiality.</p><p>Federated Learning (FL), also known as collaborative learning, was introduced by Google researchers Brendan McMahan and Daniel Ramage in 2017. It addresses the critical need for privacy-preserving machine learning. Unlike traditional approaches that centralize data on a single server, FL enables devices to collaboratively train models while keeping data localized. This ensures that sensitive information remains on users’ devices while securely sharing model updates, which are aggregated to improve the global model.</p><h3>2. How Federated Learning Works</h3><p>Federated Learning involves training AI models across decentralized devices without transferring raw data to a central server. The process typically involves these steps:</p><ol><li><strong>Initialization:</strong> A central server initializes a model and distributes it to participating devices (clients).</li><li><strong>Local Training:</strong> Each client trains the model using its local data. Raw data remains on the device.</li><li><strong>Model Update:</strong> Clients send their trained model updates (e.g., weights) to the central server.</li><li><strong>Aggregation:</strong> The server aggregates updates (e.g., using federated averaging) to refine the global model.</li><li><strong>Iteration:</strong> The global model is redistributed to clients for further training, and the process repeats until convergence.</li><li><strong>Privacy and Security:</strong> Techniques like encryption and differential privacy ensure the security and privacy of shared updates.</li></ol><p>This decentralized approach makes FL ideal for privacy-sensitive applications.</p><h3>3. Types of Federated Learning</h3><h4>Centralized Federated Learning</h4><p>In this approach, a central server orchestrates all training steps, including model initialization and aggregation. While efficient, it can create bottlenecks and single points of failure.</p><h4>Decentralized Federated Learning</h4><p>Here, clients collaborate directly, sharing model updates without a central server. This reduces bottlenecks but requires robust communication between clients.</p><h4>Heterogeneous Federated Learning</h4><p>This addresses challenges with diverse clients, such as mobile devices with varying hardware and software configurations. Frameworks like HeteroFL are designed to handle such heterogeneity.</p><h3>4. Advantages of Federated Learning</h3><p>Federated Learning (FL) offers several advantages, particularly in terms of privacy, scalability, efficiency, and real-time updates, making it highly applicable in industries like healthcare, finance, and defense.</p><ul><li><strong>Privacy Preservation:</strong> FL keeps sensitive data on local devices (e.g., smartphones or IoT devices), which ensures that raw data never leaves the device. Only model updates (such as gradients or weights) are shared with the central server for aggregation, minimizing the risk of data exposure.</li><li><strong>Data Security:</strong> FL uses advanced techniques to enhance security. For example, <strong>secure aggregation</strong> ensures the server cannot access individual updates, while <strong>homomorphic encryption</strong> allows computations on encrypted data without decryption. Additionally, <strong>differential privacy</strong> introduces noise into updates, preventing the tracking of data back to individual users. These measures ensure that even if updates are intercepted, sensitive data remains protected.</li><li><strong>Scalability:</strong> FL is well-suited for handling large-scale, distributed datasets. It enables the use of decentralized data across many devices, making it ideal for industries with vast amounts of data spread across multiple locations, such as healthcare, finance, and defense. FL can also handle heterogeneous devices with varying computing resources, as seen in <strong>Heterogeneous Federated Learning</strong>, where models are trained across different types of devices (e.g., smartphones, IoT devices).</li><li><strong>Real-Time Updates:</strong> With FL, models can continuously improve through local training on devices. As devices contribute model updates periodically, this enables real-time model updates, ensuring that AI systems adapt swiftly to new data without needing central data access or delay.</li><li><strong>Reduced Power Consumption:</strong> Since FL allows for training models locally on the device, it minimizes the energy required for sending large datasets to centralized servers. This reduces overall power consumption, making it more efficient and suitable for mobile and IoT applications where energy efficiency is critical.</li><li><strong>Improved Model Performance:</strong> By leveraging diverse data across multiple devices, FL models can learn from a wider variety of use cases, improving the generalization of the trained models. This is particularly valuable in domains like healthcare, where data from various sources and demographics can lead to more robust models.</li><li><strong>Device Compatibility:</strong> FL is designed to operate in the background, utilizing idle device time for training without affecting device performance. This ensures that users can continue using their devices without noticeable interruptions or degraded performance.</li></ul><p>These advantages make Federated Learning a powerful tool for building privacy-preserving and scalable machine learning solutions while addressing the challenges of data privacy and security in sensitive domains like healthcare, finance, and defense.</p><h3>6. Real-World Applications</h3><h4>Healthcare</h4><p>Federated Learning is revolutionizing healthcare by enabling AI models to learn from decentralized patient data across hospitals while maintaining privacy. For instance, it facilitates collaboration on medical imaging datasets (e.g., X-rays, CT scans) to enhance diagnostics without sharing sensitive information. It also helps train models for predictive analytics using Electronic Health Records (EHRs) while adhering to strict data privacy laws like HIPAA.</p><h4>Finance</h4><p>In the financial sector, Federated Learning enables banks and institutions to collaborate on identifying fraud, improving credit scoring, and assessing risks without sharing customer data directly. This approach ensures compliance with privacy regulations, such as GDPR, while leveraging collective insights to strengthen security and operational efficiency.</p><h4>Defense</h4><p>Defense applications of Federated Learning include decentralized analysis of sensor and satellite data to improve surveillance and threat detection. It also optimizes logistics and supply chain decisions in a secure manner, ensuring sensitive operational data remains protected. Additionally, it enhances cybersecurity by enabling collaborative learning of threat patterns across agencies without sharing classified information.</p><p>These short paragraphs highlight the transformative potential of Federated Learning in various domains while emphasizing its privacy-preserving benefits.</p><h3>7. Challenges and Limitations</h3><p>Despite its benefits, Federated Learning has limitations:</p><ul><li><strong>Data Heterogeneity:</strong> Non-uniform data distribution affects model performance.</li><li><strong>Communication Overhead:</strong> Frequent client-server communication can strain bandwidth.</li><li><strong>Model Accuracy:</strong> Decentralized training may result in less accurate models compared to centralized training.</li><li><strong>Limited Resources:</strong> Devices may lack the computational power for complex models.</li><li><strong>Privacy Concerns:</strong> Adversarial attacks on updates can still pose risks.</li><li><strong>Fault Tolerance:</strong> Intermittent device availability can disrupt training.</li><li><strong>Regulatory Challenges:</strong> Legal requirements may restrict its adoption.</li></ul><p>Federated Learning represents a transformative approach to privacy-preserving machine learning, opening doors to innovation in sensitive industries while addressing privacy and security concerns. However, overcoming its limitations will be crucial for its widespread adoption in the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=927202b4ccc7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[YOLO: You Only Look Once]]></title>
            <link>https://medium.com/@hamzaallagui510/yolo-you-only-look-once-5475a0289850?source=rss-601434822c56------2</link>
            <guid isPermaLink="false">https://medium.com/p/5475a0289850</guid>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[object-detection]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Allagui Mohamed Hamza]]></dc:creator>
            <pubDate>Sat, 23 Nov 2024 08:47:28 GMT</pubDate>
            <atom:updated>2024-12-02T00:26:40.605Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*zuXAnkOqJyuPIiVo.png" /></figure><h3><strong>A- What is YOLO:</strong></h3><p>With the advancement of technology, object detection plays an important role in the field of computer vision, which is a branch of machine learning focused on processing visual data, such as images or videos. Object detection consists of identifying single or multiple objects in visual data. YOLO is a real-time object detection algorithm that has become widely used in various applications. It is known for its speed and accuracy, making it one of the most popular algorithms for object detection. But where did the idea of YOLO come from?</p><h3><strong>B - Why YOLO</strong></h3><p><strong>YOLO (You Only Look Once)</strong> was developed, in 2016, to address the limitations of earlier object detection methods, such as slow multi-stage pipelines like R-CNN, which were unsuitable for real-time applications. Researchers aimed to simplify detection by creating a single neural network that could process an entire image in one pass, predicting object locations and classes simultaneously. By dividing the image into a grid, YOLO localized objects efficiently, trading some accuracy for significant speed improvements.</p><p>This unified, grid-based approach revolutionized object detection, making it faster and more practical for real-world use and real time applications, and inspired many subsequent advancements in the field.</p><h3><strong>C- YOLO architecture:</strong></h3><p>The YOLO (You Only Look Once) architecture is commonly divided into three main components: the <strong>backbone</strong>, the <strong>neck</strong>, and the <strong>head</strong>. Each plays a distinct role in the object detection pipeline, enabling YOLO to achieve high speed and accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_sIfrhpmEANh4r0d.png" /><figcaption>YOLO: One stage detection</figcaption></figure><h4>1. Backbone</h4><p>The backbone is the feature extractor of the YOLO architecture. Its primary purpose is to extract spatial and semantic information from the input image.</p><ul><li><strong>Function:</strong></li></ul><p>Converts the input image into feature maps by passing it through a series of convolutional and pooling layers.</p><ul><li><strong>Common Backbones:</strong></li></ul><p><strong>YOLOv3:</strong> Uses <strong>Darknet-53</strong>, a deep convolutional neural network with 53 layers and residual connections.</p><p><strong>YOLOv4 and later versions:</strong> Incorporate more advanced backbones like CSPDarknet (Cross-Stage Partial Networks) for better feature reuse and efficiency.</p><h4><strong>2. Neck</strong></h4><p>The neck serves as a feature aggregator and prepares the extracted features from the backbone for detection by refining and combining them.</p><ul><li><strong>Function:</strong></li></ul><p>Enhances multi-scale feature representation to detect objects of various sizes.</p><ul><li><strong>Common Necks:</strong></li></ul><p><strong>Feature Pyramid Network (FPN):</strong> Introduced in YOLOv3, it ensures feature maps from different layers are combined to detect both small and large objects.</p><p><strong>Path Aggregation Network (PAN):</strong> YOLOv4 introduced PAN to further improve the flow of information between layers and enhance object localization.</p><h4><strong>3. Head</strong></h4><p>The head is responsible for generating the final predictions, including bounding boxes, confidence scores, and class probabilities.</p><ul><li><strong>Function:</strong></li></ul><p>Decodes the aggregated feature maps to predict object locations, object scores, and class labels.</p><ul><li><strong>Key Designs:</strong></li></ul><p><strong>Anchor-Based Heads:</strong> YOLOv3 and YOLOv4 rely on predefined anchor boxes to predict bounding boxes.</p><p><strong>Anchor-Free Heads:</strong> YOLOv8 and newer versions use anchor-free designs, simplifying the architecture and improving adaptability.</p><p><strong>Decoupled Heads:</strong> YOLOv8 introduced decoupled heads, where objectness, classification, and bounding box regression tasks are processed independently for better optimization.</p><h3><strong>D- How it works</strong></h3><p><strong>YOLO, </strong>as a real-time object detection framework, combines how it works and its architecture in a streamlined process which can be broken into the following steps:</p><h4><strong>1/ Input Image Processing:</strong></h4><p>YOLO is starting by resizing the input image to a fixed size (e.g., 416x416 pixels) and normalizing its pixel values to prepare it for the neural network.</p><h4><strong>2/ Grid Division:</strong></h4><p>The image is divided into a grid (e.g., 13x13 or 19x19). Each grid cell is responsible for predicting objects whose center falls within it.</p><h4><strong>3/ Feature Extraction:</strong></h4><p>YOLO uses a <strong>convolutional neural network (CNN)</strong>, often a custom <strong>backbone</strong> like <strong>Darknet</strong>, to extract hierarchical feature maps from the image. These features capture spatial and semantic information needed for object detection.</p><h4><strong>4/ Bounding Box Prediction:</strong></h4><p>Each grid cell predicts multiple bounding boxes, including the coordinates (x, y, width, height), confidence scores (indicating the likelihood of an object), and offsets relative to the cell’s position.</p><h4><strong>5/ Class Prediction:</strong></h4><p>Each bounding box is also associated with class probabilities, which represent the likelihood of the object belonging to predefined categories (e.g., dog, car, person).</p><h4><strong>6/ Unified Detection:</strong></h4><p>YOLO combines all predictions in a single forward pass through the network, avoiding the multi-stage processes of traditional detectors like <strong>R-CNN</strong>.</p><h4><strong>7/ Post-Processing:</strong></h4><p><strong>Non-Maximum Suppression (NMS)</strong> is applied to remove redundant or overlapping bounding boxes, keeping only the most confident detections for each object.</p><p>This unified architecture allows YOLO to perform both localization and classification in one pass, ensuring fast and accurate detection suitable for real-time applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fS9Ca4t2_pk4n8gF.png" /><figcaption>How YOLO work (<a href="https://lilianweng.github.io/posts/2018-12-27-object-recognition-part-4/">source</a>)</figcaption></figure><h3>E- YOLO variants:</h3><h4>YOLOv1</h4><p>YOLOv1, created by <strong>Joseph Redmon</strong> and others researches in 2016, introduced a unified object detection framework that treated object detection as a regression problem. The architecture divided an input image into a 7x7 grid, where each grid cell predicted bounding boxes, confidence scores, and class probabilities for objects within its bounds. It used a single convolutional neural network for both localization and classification, achieving high-speed detection. However, YOLOv1 struggled with small objects and overlapping objects that spanned multiple grid cells, leading to localization errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nRQELS5xEgvDEBrJ.png" /><figcaption>YOLOv1 architecture (<a href="https://lilianweng.github.io/posts/2018-12-27-object-recognition-part-4/">source</a>)</figcaption></figure><h4><strong>YOLOv2</strong></h4><p>YOLOv2, also known as YOLO9000, improved on YOLOv1 by introducing <strong>Batch Normalization</strong>, which stabilized training and improved accuracy. It added <strong>anchor boxes</strong>, inspired by <strong>Faster R-CNN</strong>, to enhance bounding box predictions, especially for small objects. The architecture incorporated a deeper feature extractor (<strong>Darknet-19</strong>) and used multi-scale training to improve performance at different resolutions. YOLOv2 also introduced hierarchical classification, allowing it to detect up to 9000 classes.</p><h4>YOLOv3</h4><p>YOLOv3 is the last model made by <strong>Joseph Redmon</strong>. It featured a more robust architecture with <strong>Darknet-53</strong>, a deeper backbone that used residual connections for improved feature extraction. It uses <strong>multi-scale detection</strong>, predicting objects at three different scales to better handle small, medium, and large objects. The use of logistic regression for object scoring improved bounding box prediction.</p><h4><strong>YOLOv4</strong></h4><p>YOLOv4 incorporated numerous state-of-the-art techniques, including <strong>CSPDarknet53</strong> as the backbone, <strong>Spatial Pyramid Pooling (SPP)</strong> for improved feature extraction, and <strong>Path Aggregation Network (PANet)</strong> for better feature fusion. It introduced <strong>Mosaic augmentation</strong>, which enhanced the model’s ability to generalize, and <strong>CIoU loss</strong> (Complete Intersection over Union) for more precise bounding box regression. These advancements made YOLOv4 highly competitive in terms of both speed and accuracy. However, its complexity increased compared to earlier versions, requiring more computational resources.</p><h4>YOLOv5</h4><p>Developed by <strong>Ultralytics</strong>, YOLOv5 prioritized usability, offering a streamlined training pipeline and integration with modern frameworks. It introduced <strong>AutoAnchor generation</strong>, <strong>Hyperparameter Evolution</strong>, and easier deployment tools. The architecture was optimized for lightweight implementation, making it suitable for real-time applications and edge devices. However, YOLOv5, which developed using Pytorch framework was not officially linked to the original YOLO authors. Some criticized it for being more of an engineering iteration than a fundamental advancement in architecture.</p><h4>YOLOv6</h4><p>YOLOv6, developed by <strong>Meituan</strong>, focused on industrial and commercial applications, with an architecture optimized for better latency-accuracy trade-offs. It introduced an efficient backbone and neck design tailored for deployment on edge devices. While it achieved impressive performance, its adoption was less widespread than YOLOv5 due to competing versions like YOLOv7.</p><h4>YOLOv7</h4><p>YOLOv7 introduced innovations like <strong>Extended Efficient Layer Aggregation Networks (E-ELAN)</strong> for improved parameter efficiency and dynamic label assignment for better learning. It focused on small object detection and optimized resource usage, becoming one of the fastest and most accurate YOLO versions. Its design made it ideal for use cases requiring both precision and real-time performance. However, it required careful tuning and training on high-quality datasets to achieve peak performance.</p><h4>YOLOv8</h4><p><strong>YOLOv8</strong> architecture builds upon YOLOv5 with slight modifications. It introduces an anchor-free design, simplifying training and enhancing detection for varying object sizes. The architecture incorporates the C2f module, an evolution of CSPNet, and decoupled heads for objectness, classification, and bounding box prediction, allowing independent optimization. Improved loss functions, including CIoU (Complete Intersection over Union) and DFL (Distribution Focal Loss) for bounding box regression and binary cross-entropy for classification, enhance performance, especially for small or overlapping objects. YOLOv8 is lightweight and fast, making it ideal for real-time applications and deployment on edge devices. It supports diverse tasks, including semantic segmentation via the YOLOv8-Seg model, with minimal architectural modifications.</p><h4>YOLOv9</h4><p>The YOLOv9 introduces two key innovations to address information loss in deep learning: <strong>Programmable Gradient Information (PGI)</strong> and a novel architecture called <strong>Generalized Efficient Layer Aggregation Network (GELAN)</strong>. These advancements aim to tackle the challenges of data loss during feature extraction and transformation, as identified by the Information Bottleneck Principle, which often leads to unreliable gradients and suboptimal training convergence.</p><p><strong>PGI</strong> is designed to preserve complete input information, ensuring accurate gradient calculations for improved weight updates. It incorporates three components: a primary inference branch, an auxiliary reversible branch, and multi-level auxiliary information. The reversible branch retains full data information throughout the network, reducing the risk of false correlations and enhancing parameter learning. Importantly, it adds no inference overhead, as it is only active during training. Multi-level auxiliary information ensures gradients from different prediction branches are effectively utilized, supporting comprehensive learning across targets.</p><p>The <strong>GELAN</strong> architecture, on the other hand, prioritizes parameter efficiency by employing standard convolution over depth-wise convolution, improving feature extraction and transformation capabilities. GELAN’s design leverages CSP blocks, enabling high performance with fewer parameters, offering flexibility and stability in architectural design.</p><p>YOLOvYOLOv10 represents a significant evolution in object detection, combining the speed and efficiency of traditional YOLO architectures with innovative techniques inspired by transformer-based models like DETR. A key highlight of YOLOv10 is its elimination of Non-Maximum Suppression (NMS) through a novel architecture. Instead of relying on NMS to remove redundant bounding boxes during post-processing, YOLOv10 introduces a <strong>dual-label assignment system</strong> with two prediction heads. These heads work collaboratively using a <strong>consistent matching metric</strong>, aligning predictions for a one-to-one match. This approach leverages principles of the Hungarian algorithm, ensuring precise bounding box predictions without redundancy. By focusing on end-to-end optimization and streamlining both training and inference, YOLOv10 improves computational efficiency, reduces false positives, and enhances detection accuracy, making it a cutting-edge choice for real-time object detection tasks.</p><h4>YOLOv10</h4><p>YOLOv10 represents a significant evolution in object detection, combining the speed and efficiency of traditional YOLO architectures with innovative techniques inspired by transformer-based models like <strong>DETR</strong>. A key highlight of YOLOv10 is its elimination of Non-Maximum Suppression (NMS) through a novel architecture. Instead of relying on NMS to remove redundant bounding boxes during post-processing, YOLOv10 introduces a <strong>dual-label assignment system</strong> with two prediction heads. These heads work collaboratively using a <strong>consistent matching metric</strong>, aligning predictions for a one-to-one match. This approach leverages principles of the <strong>Hungarian algorithm</strong>, ensuring precise bounding box predictions without redundancy. By focusing on end-to-end optimization and streamlining both training and inference, YOLOv10 improves computational efficiency, reduces false positives, and enhances detection accuracy, making it a cutting-edge choice for real-time object detection.</p><h3><strong>F- YOLO: advantages and limitations</strong></h3><p>Advantages and drawbacks of YOLO differ from variant to another. YOLO (You Only Look Once) offers significant advantages, including real-time speed, making it ideal for applications like surveillance, autonomous driving, and robotics. Its unified architecture integrates object localization and classification into a single network, simplifying the detection pipeline and reducing computational demands. By processing the entire image at once, YOLO benefits from global context awareness, leading to more accurate predictions. Multi-scale predictions, introduced in later versions like YOLOv3, enhance its ability to detect objects of varying sizes, while its lightweight design allows deployment on edge devices. Additionally, anchor-free designs in recent versions, such as YOLOv8, simplify configuration and improve adaptability.</p><p>However, YOLO has drawbacks, such as lower accuracy for small or overlapping objects and a trade-off between speed and precision, especially in complex scenes. Its grid-based design can misrepresent objects spanning multiple cells, and anchor-based versions require careful tuning, which can be cumbersome. While efficient, larger YOLO models can have high computational costs, and dense scenes with numerous small objects remain challenging. Despite these limitations, YOLO remains a powerful tool for tasks prioritizing speed and simplicity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5475a0289850" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[YOLOF: You Only Look One-level Feature]]></title>
            <link>https://medium.com/@hamzaallagui510/yolof-you-only-look-one-level-feature-bf8a4599bcd8?source=rss-601434822c56------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf8a4599bcd8</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[object-detection]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[feature-extraction]]></category>
            <dc:creator><![CDATA[Allagui Mohamed Hamza]]></dc:creator>
            <pubDate>Fri, 22 Apr 2022 04:35:29 GMT</pubDate>
            <atom:updated>2022-04-22T04:35:29.684Z</atom:updated>
            <content:encoded><![CDATA[<p>Despite the success of feature pyramids networks (FPN) with benefits of divide and conquer solution to the optimization problem in object detection rather than multi-scale feature fusion.<br>From an optimization point of view, it exist an alternative approach to the problem, instead of employing a complex feature pyramid, using only one feature at one level for detection. You Only Look One-Level Feature (YOLOF) is a simple and efficient solution.</p><blockquote>Support paper: <a href="https://arxiv.org/pdf/1612.03144.pdf">https://arxiv.org/pdf/1612.03144.pdf</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*JbFP9oLd-Wm2j6uTdZSHwQ.gif" /></figure><p>But before we dive into all details about YOLOF let we knowing more about FPN and why we use YOLOF instead of.<br>The most popular network in detect objects is the feature pyramid networks (FPN) with two benefits:</p><p>1- multi-scale feature fusion: fusing multiple low-resolution and high-resolution feature inputs to obtain better representations.</p><p>2- divide and conquer: detecting objects on different levels regarding objects’ scales<br>FPN is considered as a Multiple-in-Multiple-out (MiMo) encoder, which encodes multi-scale features from the backbone and provides feature representations for the decoder (the detection heads)<br>Compared between Single-in-Multiple-out (SiMo), Multiple-in-Single-out (MiSo), and Single-in-Single-out (SiSo) encoders, SiMo encoder, which only has one input feature C5 and does not perform feature fusion, can achieve comparable performance with the MiMo encoder (FPN). The performance gap is less than 1 mAP. In contrast, the performance drops dramatically (≥ 12 mAP) in MiSo and SiSo encoders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9rb5N30DCxH7Ww7uzVSZEA.png" /></figure><p>These phenomenons suggest two facts: <br>1- the C5 feature carries sufficient context for detecting objects on various scales, which enables the SiMo encoder to achieve comparable results.</p><p>2- the multi-scale feature fusion benefit is far away less critical than the divide and conquer benefit, thus multi-scale feature fusion might not be the most significant benefit of FPN.</p><p>The divide-and-conquer solution , provided by FPN, is a good way but it brings memory burdens, slows down the detectors, and make detectors’ structure complex in one stage detectors . <br>Given that the C5 feature carries sufficient context for detection, YOLOF is a simple way to address the optimization problem.</p><h3><strong>YOLOF architecture</strong></h3><p>We present YOLOF, which is a simple and efficient baseline without using FPN. In YOLOF, we propose two key components, Dilated Encoder and Uniform Matching, bridging the performance gap between the SiSo encoder and the MiMo encoder.</p><p><strong>Dilated Encoder:</strong> is a SiSo encoder which two main components: the Projector and the Residual Blocks. The projection layer first applies one 1 × 1 convolution layer to reduce the channel dimension, then add one 3×3 convolution layer to refine semantic contexts, which is the same as in the FPN. After that, stacking four successive dilated residual blocks with different dilation rates in the 3 × 3 convolution layers to generate output features with multiple receptive fields, covering all objects’ scales.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*ZqS-qbbBDd50GSDOxFX_vw.jpeg" /></figure><p><strong>Uniform Matching:</strong> used to solve this imbalance problem in positive anchors, Uniform Matching strategy: adopting the k nearest anchor as positive anchors for each ground-truth box. Balance in positive samples makes sure that all ground-truth boxes participate in training and contribute equally. Besides, following Max-IoU matching, set IoU thresholds in Uniform Matching to ignore large IoU (&gt;0.7) negative anchors and small IoU (&lt;0.15) positive anchors.<br> YOLOF can be summarized into three parts: the backbone, the encoder, and the decoder:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*5usZiJeJjpgPa7N_xgnPKw.png" /></figure><p><strong>Backbone:</strong> In all models, ResNet and ResNeXt series are adopted as backbone. All models are pre-trained on ImageNet. The output of the backbone is the C5 feature map which has 2048 channels and with a down sample rate of 32.</p><p><strong>Encoder:</strong> following FPN by adding two projection layers (one 1 × 1 and one 3 × 3 convolution) after the backbone at first, resulting in a feature map with 512 channels. <br>Then, enable the encoder’s output feature to cover all objects on various scales by add residual blocks, which consist of three consecutive convolutions: the first 1 × 1 convolution apply channel reduction with a reduction rate of 4, then a 3 × 3 convolution with dilation is used to enlarge the receptive field, at last, a 1 × 1 convolution to recover the number of channels.</p><p><strong>Decoder:</strong> adopt the main design of RetinaNet, which consists of two parallel task-specific heads: the classification head and the regression head.Only adding two minor modifications. The first one is that following the design of FFN in DETR and making the number of convolution layers in two heads different.<br> There are four convolutions followed by batch normalization layers and ReLU layers on the regression head while only have two on the classification head. The second is that following Auto-assign and adding an implicit objectness prediction (without direct supervision) for each anchor on the regression head. <br>The final classification scores for all predictions are generated by multiplying the classification output with the corresponding implicit objectness.</p><h3><strong>YOLOF performance:</strong></h3><p>YOLOF is evaluated on the MS COCO benchmark and conduct comparisons with RetinaNet, DETR and YOLOv4.</p><p><strong>Comparison with RetinaNet:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*tRUGLYMSjouHiiJghplpuA.png" /></figure><p>YOLOF achieves results on par with RetinaNet+ with a 57% flops reduction and a 2.5× speed up. Due to the large stride (32) of the C5 feature, YOLOF has an inferior performance (−3.1) than RetinaNet+ on small objects. However, YOLOF achieves better performance on large objects (+3.3) thanks to dilated residual blocks in the encoder. The comparison between RetinaNet+ and YOLOF with a ResNet-101 show similar evidence as well. Although YOLOF is inferior to RetinaNet+ on small objects when applying the same backbone, it can match small objects’ performance with a stronger backbone ResNeXt while running at the same speed. Finally, with the help of multi-scale testing, we obtain our final result of 47.1 mAP and a competitive performance of 31.8 mAP on small objects.</p><p><strong>Comparison with DETR:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*e_KERiDSIgu3qRYjNBLopg.png" /></figure><p>YOLOF matches the DETR’s performance, and YOLOF gets more benefits from deeper networks than DETR.<br> Interestingly, we find that YOLOF outperforms DETR on small objects (+1.9 and +2.4) while lags behind DETR on large objects (-3.5 and -2.9). <br>More importantly, compared with DETR, YOLOF converge much faster (∼ 7×), making it more suitable than DETR to serve as a simple baseline for single level detectors.</p><p><strong>Comparison with YOLOv4:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*-B160JSskkv28ZpnL3mjVQ.png" /></figure><p>As shown in Table, YOLOF-DC5 can run 13% faster than YOLOv4 with a 0.8 mAP improvement on overall performance. YOLOFDC5 achieves less competitive results on small objects than YOLOv4 (24.0 mAP vs. 26.7 mAP) while outperforms it on large objects by a large margin (+7.1 mAP). The above results indicate that single-level detectors have great potential to achieve state-of-the-art speed and accuracy simultaneously.</p><p><strong>Error analysis (example: YOLOF vs DETR):</strong></p><p>DETR has a larger error in localization than YOLOF, which may be related to its regression mechanism. DETR regresses objects in a total anchor free manner and predicts the location globally in the image, which causes difficulties in localization.</p><p>In contrast, YOLOF relies on pre-defined anchors, which is responsible for higher missing error than DETR in the predictions. The anchors of YOLOF are sparsely and not flexible enough in the inference stage. Intuitively, there are situations that there are no high-quality anchors pre-defined around a ground-truth box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*PMkuUEf6PPujcmBPYmH7fg.png" /><figcaption>DETR vs YOLOF</figcaption></figure><p><strong>Conclusion:<br></strong>Tthe success of FPN is due to its divide-and-conquer solution to the optimization problem in dense object detection but FPN makes network structure complex, brings memory burdens, and slows down the detectors. YOLOF is a simple but highly efficient method without using FPN to address the optimization problem differently, denoted as YOLOF. We prove its efficacy by making fair comparisons with RetinaNet, DETR and YOLOv4.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf8a4599bcd8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[YOLOP: Single Shot Panoptic Driving Perception]]></title>
            <link>https://medium.com/@hamzaallagui510/yolop-single-shot-panoptic-driving-perception-eca603fe094b?source=rss-601434822c56------2</link>
            <guid isPermaLink="false">https://medium.com/p/eca603fe094b</guid>
            <category><![CDATA[yolo]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[autonomous-cars]]></category>
            <dc:creator><![CDATA[Allagui Mohamed Hamza]]></dc:creator>
            <pubDate>Wed, 13 Apr 2022 01:33:48 GMT</pubDate>
            <atom:updated>2022-04-13T02:11:52.704Z</atom:updated>
            <content:encoded><![CDATA[<p>Computer vision is applicated in several field in our life , but autonomous driving is one of the most field where panoptic driving perception systems used computer vision technology to work and make good performances.<br>In order to ensures best performance in autonomous driving, panoptic driving perception systems need to detect traffic objects, segment the drivable area,and detect lanes.</p><blockquote>Support paper: <a href="https://arxiv.org/abs/2108.11250">https://arxiv.org/abs/2108.11250</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lDF2KHnrhLbPF6Ds9snxNw.png" /></figure><p><strong>What are the previous solutions based on deep learning deal with these requirements ? </strong><br>there are several algorithms maked to tackle these requirement ( detect traffic objects, segment the drivable area,and detect lanes), but with separately way.<br>To start with traffic object detection, we found SSD-series and YOLO-series algorithms as solutions for object detection.<br>FCN, UNet and PSPNet used for semantic segmentation.<br>But for the lane detection , SCNN and Enet-SAD used to to achieve lane instance segmentation.<br>For the multi-tasks approaches , which is used to learn better representations through shared information among multiple tasks, we found <br>Mask R-CNN extends Faster R-CNN combines,with high performance, instance segmentation and object detection tasks effectively.<br>LSNet summarizes object detection, instance segmentation and pose estimation as location-sensitive visual recognition and uses a unified solution to handle these tasks.<br>and other methods like MultiNet with object detection and segmentation of the driving area simultaneously and DLT-Net which puts forward mutually interlinked sub-structures between lane area segmentation and lane boundary detection</p><p><strong>YOLOP: Single Shot Panoptic Driving Perception:</strong></p><p>YOLOP, a simple and efficient feed-forward network, handles traffic object detection, drivable area segmentation and lane detection tasks altogether.<br>It is a faster and accurate solution than previous works.</p><p><strong>The architecture of YOLOP:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*Z3N1FTL81p0dald4W2lyXw.png" /></figure><ol><li><strong>Encoder</strong><br>the encoder architecture includes two network</li></ol><p><strong>a/ Backbone Network:</strong><br>Based on the excellence of YOLOv4 on object detection, CSPDarknet used as the backbone to extract features from the images.</p><p><strong>b/ Neck Network:</strong></p><p>It’s the unit responsible of feature engineering. It composed of Spatial Pyramid Pooling (SPP) module which generates and fuses features of different scales , and Feature Pyramid Network (FPN) module with th role of fusing features at different semantic levels, and making the generated features contain multiple scales and multiple semantic level information</p><p><strong>2. Decoder:</strong></p><p>The three heads in the decoders network are used for:<br><strong>a/ detection of head:</strong><br>Similar to YOLOv4, YOLOP adopt an anchor-based multi-scale detection scheme.It uses a structure called Path Aggregation Network (PAN), a bottom-up feature pyramid network . While FPN in the neck network transfers semantic features top-down, PAN transfers positioning features bottom-up. Combining both to obtain a better feature fusion effect, thus using the multi-scale fusion feature maps in the PAN for detection.</p><p><strong>b/ Drivable Area Segment Head and Lane Line Segment Head:</strong><br>Drivable area segment head and Lane line Segment head adopt the same network structure by starting with feed the bottom layer of FPN to the segmentation branch, with the size of (W/8, H/8, 256).</p><p>After three upsampling, using the Nearest Interpolation method in our upsampling layer to reduce computation cost instead of deconvolution processes, the restored output feature map, with the size of (W, H, 2), represents the probability of each pixel in the input image for the drivable area/lane line and the background.</p><p><strong>3. Loss Function:</strong></p><p>In line with the decoders in the network, the multi-task contains three parts.The detection loss is a weighted sum of classification loss, object loss and bounding box loss as in this equation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*nROW354r2XvQ-yWo-dvI6g.png" /></figure><p>Classification loss is used for penalizing classification, object loss for the confidence of one prediction and bounding box loss used to give the error between the predicted and ground truth bounding box.<br>While α1, α2, α3 can be tuned to balance all parts of the total loss.</p><p><strong>Training paradigm:</strong></p><p>Different paradigms are attempted to train the model.Either by training end to end, and the three tasks can be learned jointly but when all tasks are related or by training our model step by step, in each step the model can focus on one or multiple related tasks regardless of those unrelated and the model can still learn adequately on each task with this paradigm.</p><p><strong>YOLOP performance:</strong><br> YOLOP is tested on the BDD100K dataset using in autonomous driving with 100k frames of pictures and annotations of 10 tasks, it is the largest driving video dataset.<br>For the traffic object detection, YOLOP model exceeds Faster R-CNN, MultiNet, and DLT-Net in detection accuracy and it can infer in real time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*vv_d5_mLnsG66IVmO4JC5w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cl01wXxqiOTGu1IcA_5meA.png" /></figure><p>As the traffic object detection, YOLOP model in the drivable area segmentation outperforms MultiNet, DLT-Net and PSPNet by 19.9%, 20.2%, and 1.9%, respectively and the inference speed is 4 to 5 times faster than theirs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*s1leSh0M6TLBCwmq3pYsrA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aRk6fJSkH-h3lrcs6m1tuQ.png" /></figure><p>YOLOP algorithm, used in panoptic driving perception systems, is one of the best variants of YOLO algorithms using</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eca603fe094b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reinforcement learning: an introduction (Part-2)]]></title>
            <link>https://medium.com/@hamzaallagui510/reinforcement-learning-an-introduction-part-2-da2469a77ace?source=rss-601434822c56------2</link>
            <guid isPermaLink="false">https://medium.com/p/da2469a77ace</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Allagui Mohamed Hamza]]></dc:creator>
            <pubDate>Wed, 30 Mar 2022 23:13:17 GMT</pubDate>
            <atom:updated>2022-03-30T23:13:17.715Z</atom:updated>
            <content:encoded><![CDATA[<p>This post is a continue of <a href="https://medium.com/@hamzaallagui510/reinforcement-learning-an-introduction-90ae5eb49584">the part-1 about the introduction of reinforcement learning </a><br>It will answers to this questions:<br><strong>What are the approaches to solving a reinforcement learning problem ?</strong></p><p>Indeed, there are three approaches:</p><ul><li>Policy-based approach</li><li>Value-based approach</li><li>Model-based approach</li></ul><p>let’s dive into them …</p><p><strong>1- Policy-Based approach:</strong><br>As we mentioned in the previous post, the policy represent the probability of what state s we will transition to when we choose an action a.</p><p>The goal is to find the optimal policy rather than the value function of a particular policy. ​</p><p>It can be either <strong>Deterministic</strong> or <strong>Stochastic</strong></p><p><strong>a- Deterministic:</strong><br>It means a policy at a given state(s) will always return the same action(a). It means, it is pre-mapped as​:<br> S = (s) =&gt; A = (a)</p><p><strong>b- Stochastic:</strong><br>It gives a distribution of probability over different actions​:<br>Stochastic Policy =&gt; p(A = a | S = s)</p><p><strong>2- Value-based approach:</strong><br>The goal of the agent is to optimize <strong>the value function</strong> <strong><em>V(s) </em></strong>which is defined as a function that tells us the maximum expected future reward the agent shall get at each state.​</p><p>The value of each state is the total amount of the reward an reinforcement learning agent can expect to collect over the future, from a particular state.</p><p>The agent will use the above value function to select which state to choose at each step(take the state with <strong>the biggest value</strong>).​</p><p><strong>3- Model-based approach:</strong><br>It consists to learn the optimal behavior <strong>indirectly</strong> by learning a model of the environment by taking actions and observing the outcomes that includes the next state and the immediate reward.</p><p>The models predict the outcomes of actions and are used to interaction with the environment to learn optimal policies.<br>The incoming posts will be about the details of reinforcement learning algorithms</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da2469a77ace" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reinforcement learning: an introduction]]></title>
            <link>https://medium.com/@hamzaallagui510/reinforcement-learning-an-introduction-90ae5eb49584?source=rss-601434822c56------2</link>
            <guid isPermaLink="false">https://medium.com/p/90ae5eb49584</guid>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Allagui Mohamed Hamza]]></dc:creator>
            <pubDate>Wed, 30 Mar 2022 22:15:26 GMT</pubDate>
            <atom:updated>2022-03-30T22:19:18.892Z</atom:updated>
            <content:encoded><![CDATA[<h3>Reinforcement learning: an introduction(Part-1)</h3><p>Here I will share with you an introduction for reinforcement learning technique.<br>This article include :<br><strong>1- what is reinforcement learning ?<br>2- what are the main elements in reinforcement learning ? <br>3- How can formulate a reinforcement learning problem ?<br>4- What are the differences between reinforcement learning and others machine learning techniques ?<br>5- What are the famous reinforcement learning algorithms ?</strong></p><p>so let’s start ..</p><p><strong>1- what is reinforcement learning ?</strong><br>reinforcement learning is as supervised and unsupervised learning, is a machine learning technique.<br>it consists of <em>a learner and a decision maker called </em><strong><em>agent </em></strong>interacts with an <strong>environment</strong> by taking <strong>actions</strong> and the environment will give him <strong>rewards</strong> and <strong>states</strong> , based on them the agent will decides which action will he do</p><figure><img alt="Reinforcment learning cycle" src="https://cdn-images-1.medium.com/max/228/1*jNP5cUgK83DGTBi8uPCZxg.png" /><figcaption>Reinforcement learning cycle</figcaption></figure><p><strong>2- what are the main elements in reinforcement learning:<br></strong>Reinforcement learning based on 5 elements:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*52bd7wCnmcf1xcphtZ3B1g.jpeg" /><figcaption>elements of reinforcement learning</figcaption></figure><p><strong>a- Agent:</strong> <br>It represent the main element in reinforcement learning . By taking <strong>actions</strong>, the agent can perceive or explore the <strong>environment</strong>(interact with it)…</p><p><strong>b- Environment:<br></strong>As the the agent , the environment also represent a main component of reinforcement learning. It’s a situation in which an agent is present or surround by .</p><p><strong>c- Actions: </strong><br>There are the moves or the events taken by an agent within the environment.</p><p><strong>d- rewards:</strong><br>A reward is a signal provided by an environment which is defined as a goal of a reinforcement learning problem (feedback of environment).</p><p><strong>e- states:</strong><br>Also called observation, which represent the situation returned by the environment after each action taken by the agent.​</p><p><strong>3-Formalizing the Reinforcement learning problem: MDP<br>Markov Decision Process (MDP)</strong> is a mathematical framework to describe an environment in reinforcement learning.​<br><strong>Markov Property:</strong> “The future is independent of the past given present.”</p><p>A Markov decision process is a tuple (S,A,R,P,γ) where:<br> S: is a set of states <br>A: is a set of actions <br>R: is the reward function<br>P: is the state transition probabilities, it represent the probability of what state s we will transition to when we choose an action a. It’s known by <strong>policy<br></strong>γ: is a discount factor (determines how much the reinforcement learning agents cares about rewards in the distant future relative to those in the immediate future)</p><p><strong>4- difference between reinforcement learning and others machine learning techniques:<br></strong>As we mentioned above, reinforcement learning is also one of the techniques of machine learning. But it differ from other techniques by</p><ul><li><strong>Dynamic learning</strong> : supervised and unsupervised learning learn about patterns in training data (static learning) while reinforcement learning learn about developing a policy that tells an agent which action to choose at each step(dynamic learning)</li><li><strong>No Explicit right Answer</strong>: using supervised and unsupervised learning we can get the explicit right answer .But in reinforcement learning the right answer is not explicit (just the agent learn from trial and error)</li><li>Exploration: while supervised learning take the answer directly from training data, reinforcement learning use the trade-off exploration/exploitation when it interact with the environment</li><li><strong>Multiple decision process:</strong> using supervised learning , we have one instance and we get one prediction . In contrast, we can have a chain of decision-making in reinforcement learning .<br>…</li></ul><p><strong>5- algorithms of reinforcement learning:</strong></p><ul><li><strong>Simple reinforcement learning:</strong><br>- Temporal difference TD(Q-learning &amp; SARSA)<br>- Monte Carlo MC (Monte Carlo Tree Search)<br>- Dynamic Programming DP<br>- Fitted Q</li><li><strong>Deep reinforcement learning:</strong><br>- Deep Q-learning/ Double Deep Q-learning<br>- Actor Critic<br>- Reinforce<br>- Compound Q-learning</li></ul><p>In this post, I try just to mention just the famous algorithms in reinforcement learning.<br>But in the coming posts, I will give all the details about each algorithms.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90ae5eb49584" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>