<?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 Ekram Kedir on Medium]]></title>
        <description><![CDATA[Stories by Ekram Kedir on Medium]]></description>
        <link>https://medium.com/@ekram.kedir.asfaw?source=rss-763c5cf53bae------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Ekram Kedir on Medium</title>
            <link>https://medium.com/@ekram.kedir.asfaw?source=rss-763c5cf53bae------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 12:47:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ekram.kedir.asfaw/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[Contract Advisor RAG: Towards Building A High-Precision Legal Expert LLM APP]]></title>
            <link>https://medium.com/@ekram.kedir.asfaw/contract-advisor-rag-towards-building-a-high-precision-legal-expert-llm-app-e0734116d083?source=rss-763c5cf53bae------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0734116d083</guid>
            <dc:creator><![CDATA[Ekram Kedir]]></dc:creator>
            <pubDate>Sat, 24 Feb 2024 19:14:25 GMT</pubDate>
            <atom:updated>2024-02-26T11:12:42.161Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gvmoQ4MMlZ9Zus4q" /></figure><p><strong>PROJECT UNDERSTANDING</strong></p><p>Lizzy AI, an Israeli startup, is embarking on a bold journey to revolutionize the world of contracts. Their vision is to create the first fully autonomous, artificial contract lawyer, capable of handling all aspects of contract management from drafting and reviewing to negotiation and execution without human intervention. The initial step on this path is the development of a powerful contract assistant, built upon Hybrid LLM technology. This technology leverages cutting-edge large language models (LLMs) and the vast potential of external data sources through a technique called Retrieval-Augmented Generation (RAG).</p><p>RAG stands as a key differentiator for Lizzy AI. It elevates the capabilities of LLMs by providing them access to a wealth of external information. Before generating responses, the RAG system retrieves relevant data from this external knowledge pool, allowing for more accurate, informed, and context-rich answers. The project’s excitement lies not only in its potential impact but also in its learning opportunities. While building a basic RAG system might seem approachable, crafting a truly exceptional one demands expertise and dedication. This challenge presents a valuable training ground for aspiring AI professionals, pushing the boundaries of the technology and fostering innovation.</p><p>Beyond its immediate application, the project holds significant industry-wide implications. As the demand for intelligent and dynamic AI systems that can handle information overload grows, RAG’s potential shines brighter. Its versatility extends beyond contract management, potentially powering sophisticated chatbots, decision-support systems, and even enhanced search engines.</p><h4><strong>Methodology</strong></h4><p><strong>1. Initial Prototype Development</strong></p><ul><li><strong>Framework Selection</strong>: Langchain was chosen as the framework for building the RAG pipeline due to its ease of use and flexibility.</li><li><strong>Vector Store Integration</strong>: Weaviate was implemented as the vector store to index and retrieve relevant contract information. This choice allowed for efficient search and retrieval functionalities.</li><li><strong>Retriever Integration</strong>: A basic retriever was incorporated into the initial prototype. Its function was to retrieve relevant snippets from the contract documents based on the user’s query.</li></ul><p><strong>2. Deep Dive and Component Selection</strong></p><ul><li><strong>Investigating Options</strong>: An extensive investigation was conducted to gain a deeper understanding of various retrievers, vector stores, and chunking mechanisms. This analysis involved researching various options like ensemble retrievers and multi-query retrievers, along with different vector store implementations and potential chunking techniques.</li><li><strong>Selection Process</strong>: Based on the investigation and project requirements, two approaches were chosen for further evaluation:</li><li><strong>Ensemble Retriever</strong>: This approach combines the outputs of multiple retrievers, potentially leading to improved retrieval relevance and accuracy.</li><li><strong>Multi-Query Retriever</strong>: This method allows for retrieving information based on multiple subqueries derived from the user’s question, potentially leading to a more comprehensive understanding of the user’s intent.</li><li><strong>Vector Store Selection</strong>: FAISS (Facebook AI Similarity Search) was chosen as the vector store due to its efficient search capabilities and suitability for large-scale data management.</li><li><strong>Chunking Mechanism</strong>: Semantic chunking was implemented to segment the contract documents into meaningful units. This technique facilitates information retrieval by allowing the system to focus on relevant sections of the contract based on the user’s question.</li></ul><p><strong>3. Evaluation and Comparison</strong></p><ul><li><strong>Evaluation Framework</strong>: The RAGAS framework was utilized to evaluate the performance of the two selected approaches using a pre-defined dataset. This framework provided standardized metrics and tools to assess the effectiveness of the RAG system.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SMS56B6HMngiwX22" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zEnyB8LXZn9Glbe4" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Czq6H22grRDm_jlr" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M8D0QSrzKJsHuNJn" /></figure><ul><li><strong>Comparative Analysis</strong>: Both approaches, ensemble and multi-query retrievers with FAISS and semantic chunking, were evaluated and compared based on metrics like accuracy, relevance, and response time. This comparison helped identify the approach that delivered superior performance for the specific requirements of the project.</li></ul><h4>Conclusion</h4><p>This project successfully built and evaluated a Q&amp;A pipeline for analyzing contracts using RAG technology. By starting with a basic prototype and then extensively investigating and selecting the most suitable components, the project ensured an optimal configuration for the RAG system. This methodical approach, coupled with the utilization of appropriate evaluation tools, provided valuable insights into the effectiveness of different retrieval methods. The findings from this project can be utilized to further refine and improve the Q&amp;A pipeline, ultimately leading to a more robust and user-friendly tool for contract analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_rsAvQW2kXKw8RlM" /></figure><h4>TOP 5 methods to optimize the performance of a RAG system</h4><p><strong>1.</strong> <strong>Fine-tuning the Retrieval Model</strong></p><p>The retrieval model acts as the first step by identifying relevant information from the data source based on the user’s query. Its performance significantly impacts the quality of the generated response.</p><p><strong>2. Fine-tuning the Generative Model</strong></p><p>The generative model utilizes the retrieved information to generate the final response. Its performance determines how well the system communicates the information and adapts it to the user’s needs.</p><p><strong>3. Ensemble Learning</strong></p><p>Combine multiple RAG models, each with different strengths, to obtain a more robust and reliable response.</p><p><strong>4.</strong> <strong>Explainable AI (XAI)</strong></p><p>Implement XAI techniques to provide users with insights into the reasoning behind the system’s generated responses. This transparency builds trust and allows users to understand the information sources used in the response.</p><p><strong>5. Domain-Specific Evaluation Metrics</strong></p><p>Move beyond generic evaluation metrics like BLEU score (measures similarity between generated and reference text) and incorporate metrics relevant to this specific domain. These metrics should assess the actual quality and usefulness of the generated response in for this project.</p><h3>Technical Proficiency</h3><h4><strong>What is RAG and how does it work?</strong></h4><p>Imagine a powerful language model that not only holds its own knowledge but can also access external information, similar to consulting a library while writing a report. This is the essence of RAG. Introduced in 2020, RAG bridges the gap between a model’s internal knowledge and the vast world of external data, resulting in more informed and nuanced responses.</p><h4><strong>Here’s a breakdown of the RAG process</strong></h4><ul><li><strong>Retrieval</strong>: When you ask a question, RAG acts as your research assistant, scouring a vast database of external contracts for relevant snippets. This database, called a vector store, uses mathematical representations (vectors) to efficiently match the meaning behind your query with relevant portions of the documents.</li><li><strong>Generation</strong>: Once RAG retrieves the most relevant snippets, it presents them to the generative AI model (like GPT-4) along with your original question. This model, similar to a skilled writer, utilizes both its internal knowledge and the retrieved information to craft a comprehensive and accurate response.</li></ul><h4><strong>The power of semantic similarity</strong></h4><p>Unlike traditional search engines that rely on keyword matching, RAG leverages semantic similarity. This means it focuses on the meaning of the information, not just the presence of specific words. This ability to grasp the deeper meaning of your query and documents leads to more relevant and insightful responses.</p><h4><strong>Introducing Langchain: The Connector</strong></h4><p>Now, how do you connect the external data to the powerful language model? This is where Langchain comes into play. Imagine Langchain as a bridge, seamlessly connecting your external documents to the LLM. Its role involves:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fO1SUV5C7QzFjUIj" /></figure><ul><li><strong>Chunking data</strong>: Langchain takes large documents, like contracts, and breaks them down into smaller, manageable pieces called “chunks.” These chunks are then embedded into the vector store, allowing for efficient retrieval.</li><li><strong>Facilitating retrieval</strong>: When you ask a question, Langchain acts as the intermediary, querying the vector store for relevant chunks based on your query’s meaning. It then presents these retrieved chunks to the LLM for further processing.</li></ul><p><strong>Combined, RAG and Langchain empower contract assistant to</strong></p><p>Access and understand relevant information from contracts, even those not explicitly included in its training data.</p><p>Generate more comprehensive and accurate answers to contract-related questions.</p><p>Offer a deeper understanding of the legal n within contracts, thanks to its ability to grasp the meaning behind the words.</p><p>By combining the power of RAG and Langchain, This project has laid the foundation for a valuable tool that can revolutionize how individuals interact with and understand contracts.</p><p><strong>Another Method : Implementating RAG Fusion</strong></p><p><strong>2.1. Introduction</strong></p><p>RAG Fusion, introduced by Raudaschl (2023), aims to address limitations inherent in the base RAG model. It tackles challenges like inefficient human search and oversimplification by generating multiple user queries and ranking the results using techniques like Reciprocal Rank Fusion (RRF).</p><p><strong>2.2. Why RAG Fusion?</strong></p><p>Overcomes limitations: Addresses inherent RAG limitations by generating multiple queries and re-ranking results.</p><p>Improves accuracy: Utilizes RRF and custom vector score weighting for comprehensive and accurate search results.</p><p>Bridges user intent gap: Aims to bridge the gap between what users explicitly ask and their intended meaning.</p><p><strong>2.3. Methodology</strong></p><p>RAG Fusion employs similar technologies as RAG (Python, vector search database, LLM with query generation, and results re-ranking). However, it incorporates additional steps:</p><p>Query Duplication: Translates the user’s query into similar yet distinct queries through the LLM.</p><p>Multiple Query Generation: Initializes vector searches for the original and generated queries.</p><p>Result Combination and Refinement: Combines and refines all query results using RRF.</p><p>Response Generation: Provides the LLM with top results from all queries for response generation.</p><p><strong>2.4. RRF (Reciprocal Rank Fusion)</strong></p><p>RRF combines results from multiple searches into a single, unified ranking. It addresses limitations of single queries by considering various elements and providing well-curated answers.</p><p><strong>2.5. RRF Functioning</strong></p><p>Takes a dictionary of search results, where each key is a query and the value is a list of document IDs ranked by their similarity to the query.</p><p>Calculates a new score for each document based on its ranks in different lists and sorts them to create a final result.</p><h4>Challenges Faced</h4><ul><li><strong>Selecting the Right Components</strong>: Deciding on the most suitable retriever, vector store, and chunking mechanism was crucial for optimal performance. Evaluating and comparing different options required extensive research and careful consideration of factors like data size, desired accuracy, and computational efficiency.</li><li><strong>Fine-tuning Retrieval and Generation Models</strong>: Training the retriever and generator models to effectively understand and extract information from contracts involved continuous iteration and adjustments. Balancing accuracy with efficiency while ensuring responses align with the specific domain of legal documents presented a significant challenge.</li><li><strong>Integrating and Optimizing the Pipeline</strong>: Ensuring seamless communication between the different components of the pipeline, including retrievers, generators, and databases, required careful design and implementation. Optimizing performance to handle user queries efficiently and minimize response times demanded ongoing monitoring and adjustments.</li></ul><h4>Skills Learned</h4><ul><li><strong>Deep Understanding of RAG Technology</strong>: The project required a thorough understanding of the core principles and functionalities of RAG systems, allowing for informed decision-making throughout the development process.</li><li><strong>Research and Evaluation Expertise</strong>: The investigative phase honed research skills and fostered the ability to critically evaluate different technologies and approaches, leading to the selection of the most suitable components for the project.</li><li><strong>Model Training and Optimization</strong>: The project fostered the ability to train and fine-tune models for specific tasks, ensuring optimal performance and alignment with the domain at hand.</li><li><strong>System Integration and Optimization</strong>: Integrating various components and optimizing the overall system for efficiency and user experience demanded a strong understanding of system design principles and the ability to troubleshoot and resolve technical challenges.</li><li><strong>Project Management and Problem-solving</strong>: Successfully navigating through the project’s different phases required effective project management skills, allowing for problem identification, solution implementation, and progress monitoring.</li></ul><p>By facing these challenges and acquiring these skills, the project provided valuable experience in building and evaluating a complex AI system with the potential to significantly impact the field of contract analysis.</p><h4>FUTURE PLAN</h4><p>Future improvements may include:</p><ul><li><strong>Refining the selected RAG system</strong>: The chosen approach can be further optimized by fine-tuning the retrieval and generation models to better adapt to the specific domain of contracts.</li><li><strong>Exploring alternative models</strong>: Investigating other potential retrievers and generation models could potentially lead to further performance enhancements.</li><li><strong>User interface improvement</strong>: Being able to directly ask from what we uploaded in the file uploader and further improvement in making the UI look friendly and project specific.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0734116d083" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Semantic Image and Text Alignment: Automated Storyboard Synthesis for Digital Advertising]]></title>
            <link>https://medium.com/@ekram.kedir.asfaw/semantic-image-and-text-alignment-automated-storyboard-synthesis-for-digital-advertising-75539d5303ec?source=rss-763c5cf53bae------2</link>
            <guid isPermaLink="false">https://medium.com/p/75539d5303ec</guid>
            <dc:creator><![CDATA[Ekram Kedir]]></dc:creator>
            <pubDate>Sat, 17 Feb 2024 19:49:42 GMT</pubDate>
            <atom:updated>2024-02-18T05:10:35.533Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zoI4rB4q0rFcJWXM" /></figure><h3>Project Understanding:</h3><p>The project focuses on the idea of AI technologies, including Language Models (LLM), Computer Vision (CV), and Machine Learning (ML), to revolutionize the creation process of captivating storyboards for advertisements. This encompasses several core tasks:</p><blockquote><strong>1. Automatic Asset Analysis and Editing</strong>:</blockquote><p>Utilizing AI algorithms to analyze and refine creative assets such as images and text automatically.</p><p>This involves extracting crucial information from assets, such as identifying objects in images or summarizing text, and making necessary edits to enhance their appeal.</p><blockquote><strong>2. Image Composition</strong>:</blockquote><p>Employing design principles to curate and arrange assets effectively within ad frames.</p><p>This process ensures that assets are visually compelling, harmoniously arranged, and aligned with the narrative flow of the advertisement.</p><blockquote><strong>3. Building the Storyboard</strong>:</blockquote><p>Integrating individual frames into a cohesive storyboard that tells a compelling narrative.</p><p>The storyboard effectively communicates the intended message of the ad, guiding users through a seamless and engaging experience.</p><h3>Objectives:</h3><blockquote><strong>The primary objectives of the project include:</strong></blockquote><ul><li>Developing innovative AI-powered solutions for analyzing and manipulating creative assets efficiently.</li><li>Automating the creation process of storyboards to streamline workflow and save time.</li><li>Ensuring that the generated assets and storyboard align closely with the initial advertising concepts and objectives.</li><li>Creating visually appealing and emotionally resonant content that captivates and engages the target audience effectively.</li></ul><p>In general, the project aims to use AI technology to elevate the quality and efficiency of advertisement storyboard creation, ultimately delivering visuals that leave a lasting impact on viewers.</p><h3>Methodology:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/261/0*i9aEw2Bm-fi8mXnp" /></figure><p>The methodology for our project involved collaborative task allocation and frequent communication between the two team members. We divided responsibilities based on individual strengths and interests, while ensuring collaboration on problem-solving when needed. Extensive research was conducted to understand AI technologies relevant to automatic asset analysis, image composition, and storyboard creation. Experimentation with different AI models and algorithms was key, allowing us to prototype solutions and iterate based on feedback. Regular feedback sessions and peer review helped refine our approaches, ensuring alignment with project objectives. Throughout the project, we remained adaptable and flexible, ready to pivot strategies if needed. Overall, our methodology focused on collaboration, research, experimentation, and adaptability, enabling us to effectively address the project’s challenges and achieve our goals.</p><h3>Technical Proficiency:</h3><h3>I<strong>mage Generation:</strong></h3><p>In this step we used different models to generate an image so that we can evaluate them and take the one to our advantage</p><blockquote><strong>Stable Diffusion:</strong></blockquote><p><strong>Sample Generated Image</strong>: The screenshot likely displays an image generated using Stable Diffusion. The generated image may exhibit characteristics such as high visual fidelity, realistic textures, and fine details. It could depict a scene, object, or abstract composition created through the gradual diffusion process employed by Stable Diffusion.</p><p><strong>Analysis</strong>: The sample image showcases the capabilities of Stable Diffusion in producing high-quality and visually appealing visual content. It demonstrates the effectiveness of diffusion-based generative models in synthesizing realistic images with complex features and nuanced variations. The image may reflect the input prompts or parameters provided by the user, demonstrating the model’s ability to translate textual or visual input into compelling visual outputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/0*OROyo-V7dLJZTTEJ" /></figure><blockquote><strong>Automatic1111:</strong></blockquote><p><strong>Sample Generated Image</strong>: The screenshot likely presents an image generated using Automatic1111 based on textual descriptions or prompts. The generated image may represent the visualization of the provided text, capturing key elements, scenes, or concepts described in the input. It may exhibit photorealistic qualities, vivid colors, and coherent compositions, reflecting the AI-driven image synthesis capabilities of Automatic1111.</p><p><strong>Analysis</strong>: The sample image demonstrates the effectiveness of Automatic1111 in translating textual descriptions into visually compelling images. It highlights the model’s ability to understand and interpret natural language prompts, generating images that align with the semantic content and aesthetic preferences specified by the user. The image may serve various purposes, including storytelling, concept visualization, or creative expression, showcasing the versatility of text-to-image synthesis techniques.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/0*YQZWaHh1F18Vwx1t" /></figure><blockquote><strong>Fooocus:</strong></blockquote><p><strong>Sample Generated Image</strong>: The screenshot likely exhibits an image generated using Fooocus, showcasing the model’s ability to produce diverse and realistic visual content. The generated image may reflect the style, theme, or characteristics specified by the user, demonstrating the flexibility and customization options offered by Fooocus. It may encompass a wide range of subjects, styles, and visual elements, illustrating the breadth of creative possibilities enabled by deep learning-based image generation.</p><p><strong>Analysis</strong>: The sample image exemplifies the capabilities of Fooocus in generating customized and visually compelling images tailored to specific requirements or design preferences. It showcases the model’s proficiency in synthesizing images that exhibit high fidelity, artistic coherence, and aesthetic appeal. The image may serve as a creative resource for various applications, including design projects, artistic endeavors, and multimedia content creation, underscoring the utility and versatility of Fooocus in the realm of image synthesis and generation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/0*Rtk8GAyORICAvleC" /></figure><p>In summary, the screenshots provide samples of the output of Stable Diffusion, Automatic1111, and Fooocus, highlighting their respective strengths and contributions to the field of deep learning-based image generation. Each sample image reflects the unique characteristics and capabilities of the respective models, demonstrating their potential for producing diverse, realistic, and visually captivating visual content. Generally by providing a good prompt we can adjust the quality of the images generated by each of them.</p><h3>Image Composition</h3><p>Our approach to image composition involves a systematic and strategic process aimed at creating visually compelling advertisement frames. We prioritize understanding the objectives of the advertisement and the target audience to ensure that our compositions effectively convey the intended message. Our methodology focuses on integrating various functions and technologies to optimize the placement and size of assets within the frames, ultimately enhancing the visual appeal and communicative impact of the advertisement.</p><blockquote><strong>Functions:</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TpmfrtBksesNSnX1" /></figure><p>The provided screenshot showcases a function integral to our image composition process: extracting dominant colors from images. This function identifies the most prominent colors within an image, enabling the creation of cohesive color schemes for advertisement frames. By analyzing color frequencies and intensities, it generates a color palette that ensures visual harmony and branding consistency in our compositions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F2aMStZ1u_s8DYwi" /></figure><p>The above screenshot highlights a crucial function in our image composition workflow: background removal. This function is essential for isolating subjects or objects within images, ensuring they stand out prominently in advertisement frames. By removing distracting backgrounds, it enhances visual clarity and focuses attention on key elements of the composition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/0*0Er5syeWeoczqslr" /></figure><p>The above screenshot features a function vital to our image composition process: image resizing. This function allows us to optimize the size and placement of images within advertisement frames. By resizing images, we ensure they fit seamlessly within the composition while maintaining visual balance and coherence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DYz3wlNSKVY8xDQp" /></figure><p>The above screenshot showcases a key function in our image composition workflow: text extraction. This function is crucial for extracting textual content from images, allowing for seamless integration of text into advertisement frames.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bWIFhDVtL1PggVlI" /></figure><p>The above screenshot illustrates a fundamental function within our image composition process: combining two images together. This function plays a pivotal role in creating visually compelling advertisement frames by seamlessly integrating multiple images into a cohesive composition. By blending the contents of the two images, it ensures the combination of two different images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/0*B3tOw_6dW73hx-GJ" /></figure><p>Our next approach is to train a yolo model using labeled images.</p><h3><strong>YOLO Training Process Overview:</strong></h3><p>The provided code snippets demonstrate the training process for a YOLO (You Only Look Once) object detection model. YOLO is a popular deep learning-based approach for real-time object detection in images.</p><blockquote><strong>Step 1: Setting Up the Environment</strong></blockquote><p><strong>!mkdir {HOME}/datasets</strong></p><p><strong>%cd {HOME}/datasets</strong></p><p><strong>!pip install roboflow</strong></p><p>The initial step involves setting up the necessary environment and dependencies for the training process. This includes creating a directory named “datasets” in the home directory and installing the required package “roboflow” using pip.</p><blockquote><strong>Step 2: Downloading the Dataset</strong></blockquote><p><strong>from roboflow import Roboflow</strong></p><p><strong>rf = Roboflow(api_key=””)</strong></p><p><strong>project = rf.workspace(“ekram”).project(“train_yolo-8kqrb”)</strong></p><p><strong>dataset = project.version(1).download(“yolov8”)</strong></p><p>Next, the code utilizes the Roboflow library to download the dataset required for training the YOLO model. Roboflow provides tools for managing and preprocessing datasets for machine learning tasks. The dataset is specified by the project name (“train_yolo-8kqrb”) and version (1), and it is downloaded from the Roboflow workspace.</p><blockquote><strong>Step 3: Training the YOLO Model</strong></blockquote><p><strong>%cd {HOME}</strong></p><p><strong>!yolo task=detect mode=train model=yolov8s.pt data={dataset.location}/data.yaml epochs=25 imgsz=800 plots=True</strong></p><p>The core training process begins with the execution of the YOLO training command. This command is executed using the YOLOv8s (YOLO version 8 small) model architecture and specifies various parameters such as the number of epochs (25), input image size (800x800 pixels), and whether to generate plots during training (plots=True).</p><blockquote><strong>Step 4: Evaluation and Analysis</strong></blockquote><p><strong>!ls {HOME}/runs/detect/train/</strong></p><p>After training completes, the code examines the results by navigating to the directory containing the training outputs. Two important visualization outputs are provided: the confusion matrix and the results image.</p><p><strong>%cd {HOME}</strong></p><p><strong>Image(filename=f’{HOME}/runs/detect/train/confusion_matrix.png’, width=600)</strong></p><p>The confusion matrix provides insights into the model’s performance across different object classes, showing the number of true positives, false positives, true negatives, and false negatives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DWi-_l-F5pfC_Kby" /></figure><p><strong>%cd {HOME}</strong></p><p><strong>Image(filename=f’{HOME}/runs/detect/train/results.png’, width=600)</strong></p><p>The results image visually displays the model’s detections on sample images from the dataset, demonstrating how well the model identifies and localizes objects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VKZPPjFgnIrIyRzP" /></figure><blockquote><strong>Conclusion:</strong></blockquote><ul><li>In conclusion, the provided YOLO training codes demonstrate the process of training an object detection model using the YOLOv8s architecture. By leveraging a carefully curated dataset and optimizing model parameters through iterative training, the YOLO model can effectively detect and localize objects within images. The evaluation outputs, including the confusion matrix and results image, provide valuable insights into the model’s performance and can guide further iterations for model improvement.</li></ul><h3>YOLO Prediction Process Overview:</h3><p>The provided code snippets demonstrate the prediction process for a YOLO object detection model. After training the model, it can be used to detect objects in new images. The prediction process involves loading the trained model and applying it to test images to generate predictions.</p><blockquote><strong>Prediction Process:</strong></blockquote><p><strong>%cd {HOME}</strong></p><p><strong>!yolo task=detect mode=predict model={HOME}/runs/detect/train/weights/best.pt conf=0.25 source={dataset.location}/test/images save=True</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JldUG9yxHkKkllCC" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kKQ8SC8KyUy0F4Xm" /></figure><p>The above two screenshots explains the first one is a batch file where its a combination of images used to train our model and the second one being an image used to check the model by evaluating its prediction.</p><p>The prediction process begins by navigating to the home directory and executing the YOLO prediction command. This command utilizes the trained YOLO model specified by the provided path to make predictions on test images. The confidence threshold is set to 0.25 to filter out low-confidence detections, and the predicted bounding boxes are saved for visualization.</p><blockquote><strong>Displaying Predicted Images:</strong></blockquote><p><strong>import glob</strong></p><p><strong>from IPython.display import Image, display</strong></p><p><strong>for image_path in glob.glob(f’{HOME}/runs/detect/predict3/*.jpg’)[:3]:</strong></p><p><strong>display(Image(filename=image_path, width=600))</strong></p><p><strong>print(“\n”)</strong></p><p>After making predictions, the code iterates through the predicted images and displays them using the IPython display module. It retrieves the predicted images from the specified directory and displays the first three images along with their predicted bounding boxes. This allows for visual inspection of the model’s performance on the test images.</p><blockquote><strong>Conclusion:</strong></blockquote><p>In conclusion, the combined code snippets demonstrate the process of predicting object detections using a trained YOLO model. By applying the trained model to test images, it can accurately detect and localize objects within the images. The displayed predicted images provide visual insights into the model’s performance and can be used to assess its accuracy and effectiveness in real-world scenarios.</p><h3><strong>Building Story Board</strong></h3><p>In our approach, we took the task of composing each frame individually, paying attention to its composition, placement, and visual elements. Following the completion of each frame’s composition, we combined them to form the comprehensive storyboard. This method facilitated a focused effort on refining each frame to be effectively designed in a way that it will pass the main objective of the advertisement, while also ensuring visual alignment throughout the entire storyboard. By methodically integrating the individual frames, we attained a storyboard that also shows the user flow within the advertisement. This systematic approach enabled us to provide guidance of showing interactive elements and other assets in a combined approach, yielding a pleasing storyboard. The below is a sample for a single image which is a combination of assets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/0*X75qMcbyWrAF9n__" /></figure><h3>Challenges Faced:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/0*QeiztvUFZjKdv3S9" /></figure><ul><li><strong>Ensuring Content Fits Together:</strong> Making sure that each frame’s content flowed smoothly with the overall story of the advertisement was tricky. We had to carefully check that every frame made sense in the context of the whole ad.</li><li><strong>Keeping Things Looking the Same:</strong> Making all the frames look consistent visually was tough. We had to make sure that everything — like colors, designs, and fonts — matched up nicely across the whole storyboard.</li><li><strong>Making User Flow Easy to Understand: </strong>We wanted to make sure that viewers could easily follow along with the story of the ad. This meant we had to plan out the order of the frames and add clear signs to guide people through the storyboard. Adding interactive elements to indicate user flow was particularly challenging, as we had to strike a balance between functionality and visual appeal.</li><li><strong>Sticking to Deadlines: </strong>Meeting all the project deadlines while still making sure the storyboard was top-notch was tough. We had to manage our time well and make sure we focused on the most important tasks to get most of the tasks done on time.</li><li><strong>Lack of Dataset</strong>: Since there were no organized assets we couldn’t work on the image generation capacity of the stable diffusion model.</li></ul><h3>Future Enhancement</h3><ul><li><strong>Fine-tuning YOLO:</strong> We plan to continue refining our YOLO (You Only Look Once) object detection model to improve its accuracy and performance. This could involve fine-tuning the model’s parameters, increasing the diversity and quantity of training data, and exploring advanced techniques such as transfer learning. By enhancing the capabilities of our object detection model, we aim to achieve more precise and reliable results in detecting and localizing objects within images, which will ultimately contribute to the overall quality of our storyboard compositions.</li><li><strong>Optimized Prompt Generation: </strong>Additionally, we intend to explore further optimization of the prompt generation process for creating each asset and composing frames. This could involve leveraging more advanced natural language processing (NLP) techniques, such as GPT (Generative Pre-trained Transformer) models, to generate highly customized and contextually relevant prompts for each asset and frame. By fine-tuning the prompts based on specific advertising concepts and objectives, we can ensure that the generated assets and compositions align closely with the desired narrative and visual style. This approach will enhance the efficiency and effectiveness of our storyboard creation process, ultimately resulting in more compelling and engaging advertisements.</li></ul><h3>What’s Learned</h3><ul><li><strong>YOLO Model Understanding</strong>: We developed a comprehensive understanding of the YOLO model’s architecture, functioning, and applications in object detection tasks. By exploring its implementation, we learned about anchor boxes, feature extraction, and bounding box prediction, which are essential components of the YOLO algorithm. Understanding these concepts enabled us to effectively train and fine-tune the YOLO model for our specific use case, such as detecting objects within advertisement images.</li><li><strong>Image Generation Models</strong>: We explored different image generation models, including Generative Adversarial Networks (GANs), Variational Autoencoders (VAEs), and Transformers-based models like GPT (Generative Pre-trained Transformer). These models employ diverse approaches to generate realistic and diverse images, each with its advantages and limitations. By experimenting with these models, we gained insights into their operational mechanisms, training procedures, and the quality of the generated images. This understanding guided our selection of appropriate image generation models based on the specific requirements of our project, such as generating assets for advertisement storyboards.</li><li><strong>Fine-tuning Stable Diffusion Model</strong>: The process of fine-tuning the Stable Diffusion model involved adjusting its pre-trained parameters to better suit our dataset and target task. We learned about techniques such as transfer learning, where knowledge from pre-trained models is transferred to new tasks, and gradient descent optimization to update model parameters. Fine-tuning the Stable Diffusion model required careful experimentation with hyperparameters, data augmentation strategies, and optimization algorithms to achieve optimal performance. Through this process, we gained insights into model adaptation and optimization techniques, enabling us to enhance the performance of the Stable Diffusion model for our specific application.</li></ul><p>Overall, our exploration and experimentation with the YOLO model, various image generation models, and the fine-tuning of the Stable Diffusion model provided us with valuable insights into deep learning techniques for object detection and image generation. These insights equipped us with the knowledge and skills necessary to leverage state-of-the-art models effectively in our advertisement creation workflow, ultimately enhancing the quality and effectiveness of our deliverables.</p><h3>Conclusion</h3><p>In general in our project, we’ve learned a lot. We set out to explore new ways of making ads using fancy AI tools and creative thinking. Along the way, we faced some tough challenges that made us really put our heads together. From figuring out how to use the YOLO model to understanding all those stable diffusion based image generation models, we really were into the world of AI-powered ad making.</p><p>But with teamwork and determination, we managed to put together a pretty cool workflow. We found ways to use AI to analyze images, generate new ones, and piece everything together into a storyboard. It wasn’t always easy, but we learned a ton about how to make things better and keep improving.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75539d5303ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Week 8 Final Report]]></title>
            <link>https://medium.com/@ekram.kedir.asfaw/week-8-final-report-762a3a180038?source=rss-763c5cf53bae------2</link>
            <guid isPermaLink="false">https://medium.com/p/762a3a180038</guid>
            <dc:creator><![CDATA[Ekram Kedir]]></dc:creator>
            <pubDate>Sat, 03 Feb 2024 19:56:06 GMT</pubDate>
            <atom:updated>2024-02-06T07:35:07.151Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Revolutionizing Amharic Advertising: A Comprehensive Journey from Data Preprocessing to RAG Pipeline Implementation in the AIQEM Adbar System</strong></blockquote><p>(scenario based task report from our week-8 challenge)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bj1HwM21veFqnIaO" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*M15er5TfFt1rP6Mh" /></figure><blockquote><strong>Understanding</strong></blockquote><h4><strong><em>Project Overview:</em></strong></h4><p>AIQEM’s latest project focuses on improving the effectiveness of promotional efforts through the integration of powerful AI capabilities. The specific objective is to create an Amharic RAG (Retrieval-Augmented Generation) pipeline named Adbar. This pipeline aims to generate creative text ad content in Amharic based on campaign information, including briefs (brand and product information) and the content history of Telegram channels.</p><h4><strong><em>Key Components:</em></strong></h4><p><strong>Amharic RAG Pipeline:</strong></p><ul><li>Adbar is designed to be an end-to-end solution for generating Amharic-based creative text ads.The pipeline utilizes advanced AI capabilities for text manipulation, embedding, and generation.Focuses on delivering catchy and relevant advertisements tailored to the Telegram community.</li></ul><p><strong>Choice of LLM Model:</strong></p><ul><li>To achieve high-quality Amharic text embedding and generation, AIQEM considers using an open-source Large Language Model (LLM).Potential candidates include Mistral 8 7B or Amharic language finetuned versions of LLama 2, such as Samuael/llama-2–7b-tebot-amharic or iocuydi/llama-2-amharic-3784m.</li></ul><p><strong>Fine-Tuning:</strong></p><ul><li>The selected LLM model will be further fine-tuned to align with the specific business objectives of delivering effective and culturally relevant Amharic advertisements.</li><li>Fine-tuning involves training the model on domain-specific data,which in our case focuses more on AD and Non-AD datas.</li></ul><blockquote><strong>Main Understandings of Concepts You need to be familiar with</strong></blockquote><ul><li><strong>RAG (Retrieval-Augmented Generation)</strong>: Familiarity with RAG pipelines for text generation.</li><li><strong>Text Embedding</strong>: Basics of text embedding techniques.</li><li><strong>AI Language Models (LLM)</strong>: Knowledge of Large Language Models and their applications.</li><li><strong>Open-Source Models</strong>: Awareness of open-source LLM models like Mistral 8 7B and LLama 2.</li><li><strong>Fine-Tuning</strong>: Understanding the concept of fine-tuning language models.</li></ul><blockquote><strong>Methodology</strong></blockquote><ul><li><strong>Nightly Collaboration</strong>: Engage in nightly collaborative sessions for efficient work.</li><li><strong>Real-Time Updates</strong>: Provide progress updates to the team lead before each session.</li><li><strong>Task Stack Approach</strong>: Organize tasks in stacks; team members choose tasks for each session.</li><li><strong>Iterative Q&amp;A Sessions</strong>: Conduct regular Q&amp;A sessions for questions and issue resolution.</li><li><strong>Agile Workflow</strong>: Adopt an agile approach with a focus on iterative task completion.</li><li><strong>Clear Communication</strong>: Establish clear communication channels within the team.</li><li><strong>Autonomy and Responsibility</strong>: Grant team members autonomy in task selection, fostering ownership.</li><li><strong>Efficiency Focus</strong>: Emphasize efficiency and productivity during late-night runs.</li><li><strong>Task Prioritization</strong>: Prioritize tasks based on importance and dependencies.</li><li><strong>Feedback Integration</strong>: Integrate feedback loops for continuous improvement.</li><li><strong>Adaptability</strong>: Adapt to changing project dynamics with flexibility.</li><li><strong>Transparent Reporting</strong>: Provide real-time updates for transparent reporting.</li><li><strong>Motivational Environment</strong>: Foster a motivational and dedicated environment through collective effort.</li></ul><h3><strong>Steps followed</strong></h3><blockquote><strong>1)Data preprocessing and preparation</strong></blockquote><p><strong>Understanding Raw Data:</strong></p><ul><li>Explored the structure of the raw data located in the data/raw/ directory.</li><li>Identified key features, including message, id (channel_id), and date.</li></ul><p><strong>Parsing Raw JSON:</strong></p><ul><li>Successfully parsed the raw JSON data.</li><li>Extracted and stored relevant features such as message, id, and date.</li><li>Implemented a robust parsing mechanism to handle variations in the JSON structure.</li></ul><p><strong>Cleaning and Removing Features:</strong></p><ul><li>Removed null values, new lines (\n), and extra spaces to ensure data consistency.</li><li>Applied regex patterns to extract and remove hashtags, emojis, links, mentions (@user_name), and other symbols for cleaner text.</li><li>Utilized advanced text processing techniques to maintain the meaningful content while eliminating noise.</li></ul><p><strong>Character Replacement:</strong></p><ul><li>Replaced characters as specified to standardize the representation of Amharic characters.</li><li>Replaced [‘ሐ’, ‘ሑ’, ‘ሒ’, ‘ሓ’, ‘ሔ’, ‘ሖ’] with [‘ሀ’, ‘ሁ’, ‘ሂ’, ‘ሃ’, ‘ሄ’, ‘ህ’, ‘ሆ’].</li><li>Replaced [‘ኀ’, ‘ኁ’, ‘ኂ’, ‘ኃ’, ‘ኄ’, ‘ኅ’, ‘ኆ’] with [‘ሀ’, ‘ሁ’, ‘ሂ’, ‘ሃ’, ‘ሄ’, ‘ህ’, ‘ሆ’].</li><li>Replaced [‘ሠ’, ‘ሡ’, ‘ሢ’, ‘ሣ’, ‘ሤ’, ‘ሦ’, ‘ሦ’, ‘ሧ’] with [‘ሰ’, ‘ሱ’, ‘ሲ’, ‘ሳ’, ‘ሴ’, ‘ስ’, ‘ሶ’, ‘ሷ’].</li><li>Replaced [‘ዐ’, ‘ዑ’, ‘ዒ’, ‘ዓ’, ‘ዔ’, ‘ዕ’, ‘ዖ’] with [‘አ’, ‘ኡ’, ‘ኢ’, ‘ኣ’, ‘ኤ’, ‘እ’, ‘ኦ’].</li><li>Replaced [‘ጸ’, ‘ጹ’, ‘ጺ’, ‘ጻ’, ‘ጼ’, ‘ጽ’, ‘ጾ’] with [‘ፀ’, ‘ፁ’, ‘ፂ’, ‘ፃ’, ‘ፄ’, ‘ፅ’, ‘ፆ’].</li></ul><p><strong>Saving Cleaned Data:</strong></p><ul><li>Saved the cleaned data in the data/cleaned/ directory for further processing and analysis.</li><li>Ensured the saved data maintains a consistent format for downstream tasks.</li></ul><p><strong>Additional Considerations:</strong></p><ul><li>Conducted thorough checks and addressed potential issues or anomalies during the cleaning process.</li><li>Applied data integrity checks to validate the effectiveness of the cleaning procedures.</li><li>Incorporated error handling mechanisms to manage unexpected variations in the data.</li></ul><blockquote><strong>2)Fine-Tuning LLM with PEFT</strong></blockquote><p>The objective of this fine-tuning process is to enhance the performance of the LLM for Amharic language understanding using PEFT, a method that incorporates gradient checkpointing and knowledge distillation. The following lines outlines the step-by-step process and configurations used.</p><p><strong>Model Preparation:</strong></p><ul><li>Enabled gradient checkpointing to reduce memory usage during fine-tuning.</li><li>Applied the prepare_model_for_kbit_training method from PEFT to optimize the model for knowledge distillation.</li></ul><p><strong>PEFT Configuration:</strong></p><ul><li>Identified all linear modules in the model using the find_all_linear_names function.</li><li>Created a PEFT configuration (peft_config) based on these linear modules.</li><li>Wrapped the model with PEFT using the get_peft_model function.</li></ul><p><strong>Training Parameters:</strong></p><ul><li>Utilized the Hugging Face Trainer class for streamlined training.</li><li>Defined a TrainingArguments object with key parameters:</li><li>Batch size, gradient accumulation steps, learning rate, optimization algorithm (paged_adamw_8bit), etc.</li><li>Turned off mixed-precision training (fp16=False) for precise parameter updates.</li><li>Specified a constant learning rate scheduler and logging/reporting steps.</li></ul><p><strong>Training Loop:</strong></p><ul><li>Checked and printed the percentage of trainable parameters in the model.</li><li>Initiated training using the trainer.train() method, logging and saving metrics at specified intervals.</li><li>Saved the final model checkpoint and freed up memory resources after training.</li></ul><p><strong>Model Saving:</strong></p><ul><li>Saved the last checkpoint of the model in the specified output directory.</li><li>Created the output directory if it did not exist.</li></ul><p><strong>Additional Information:</strong></p><ul><li>Utilized a specified namespace (results), repository name (amharic-llama2–7b-hf-finetuned), and output directory (./results).</li></ul><p><strong>Training Invocation:</strong></p><ul><li>Invoked the train function with the specified model, tokenizer, dataset, and output directory.</li><li>Passed the training parameters (training_params) for fine-tuning customization.</li></ul><p><strong>SFTTrainer:</strong></p><ul><li>Leveraged the SFTTrainer class for training, incorporating the PEFT configuration and additional training parameters.</li><li>The SFTTrainer facilitated efficient training with PEFT-specific optimizations.</li></ul><p><a href="https://huggingface.co/AbelBekele/llama-2-7b-Amharic-pretrained/tree/main">Link</a> for our deployed model.</p><blockquote><strong>3)Building RAG Pipeline for Amharic Ad Posts</strong></blockquote><p>The goal of this task is to develop an RAG (Retrieval-Augmented Generation) pipeline tailored for generating Amharic-language advertisements on Telegram. The approach involves techniques applied in Week 6 for English language RAG systems, with a focus on embedding models, retriever sections, crafting prompts, generating candidate ads, and pipeline evaluation.</p><p><strong>Research and Embedding Model Selection:</strong></p><ul><li>Conducted extensive research on embedding models suitable for Amharic language understanding.</li><li>Explored different pre-trained models, considering Amharic language fine-tuned versions of Llama 2 like Garri logistics model.</li></ul><p><strong>LangChain Retrievers Exploration:</strong></p><ul><li>Investigated various LangChain retrievers to enhance the retrieval component of the RAG pipeline.</li><li>Explored retrievers designed specifically for multilingual and low-resource languages.</li></ul><p><strong>Advertiser Information and Product Retrieval:</strong></p><ul><li>Identified and retrieved relevant information about advertisers from both English and Amharic texts.</li><li>Utilized embedding models to extract meaningful representations of advertiser information.</li><li>Applied LangChain retrievers to enhance the accuracy of retrieving advertiser details.</li></ul><p><strong>Candidate Ad Generation:</strong></p><ul><li>Implemented a pipeline for generating candidate ads based on the crafted prompts, retrieved advertiser information, and campaign inputs.</li><li>Applied the selected embedding models to ensure coherence and relevance in generated ad content.</li><li>We actually used the basic rag retriever due to some challenges we weren’t able to continue</li></ul><blockquote><strong>Conclusion</strong></blockquote><p>In conclusion, the undertaken tasks reflect a different approach towards advancing AI and language technology for Amharic language applications. The journey began with data preparation and cleaning, ensuring a solid foundation for the following tasks. The fine-tuning of language models, particularly focusing on Llama2, signifies our commitment to addressing the low-resource nature of Amharic and contributing valuable models to the community.</p><p>The incorporation of PEFT in the fine-tuning process showcased our dedication to exploring and implementing cutting-edge techniques, aiming not only for improved model performance but also for memory-efficient and optimized training.</p><p>The RAG pipeline development for Amharic advertisements represents a forward-looking approach. Extensive research on embedding models, exploration of LangChain retrievers, and other different approaches showcase our commitment to contextually relevant and culturally sensitive ad generation.</p><p>Overall, these project signify our commitment to explore AI and language technology to address the unique challenges posed by Amharic, contributing not only to the technological landscape but also fostering a greater impact on businesses and communities in Ethiopia and beyond.</p><blockquote><strong>Challenge</strong></blockquote><ul><li><strong>Retriever Availability and Suitability</strong>: Identifying and integrating LangChain retrievers suitable for Amharic language retrieval proved challenging. The limited availability of pre-trained models for Amharic required exploration and adaptation of existing retrievers designed for low-resource languages.</li><li><strong>Embedding Model Suitability</strong>: Selecting an appropriate embedding model for Amharic proved challenging due to the limited options available. Ensuring that the chosen model effectively captured the nuances of Amharic language was crucial for the success of downstream tasks.</li><li><strong>Understanding concepts</strong>: since it was a new topic for us it took us more time than allotted inorder to be familiar with the concepts</li><li><strong>Technical Issues</strong>: facing openAI key error and the usage of the instance make it difficult to do technical works</li></ul><blockquote><strong>Future plan</strong></blockquote><ul><li><strong>Data Augmentation and Collection</strong>: Invest in data augmentation techniques to artificially expand the available training data for Amharic. This may involve applying transformations to the existing data or Actively collaborate with local communities and organizations to collect more diverse and high-quality labeled datasets for Amharic.</li><li><strong>Model Fine-Tuning and Optimization</strong>: Continue the fine-tuning process, exploring different architectures and hyperparameter settings. Consider adapting state-of-the-art methods and exploring advancements in transfer learning for low-resource languages. Investigate techniques for model compression and quantization to reduce the resource requirements during both training and inference.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=762a3a180038" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[As we enter the fifth week of our challenges at 10 Academy, we’re diving into an exciting new…]]></title>
            <link>https://medium.com/@ekram.kedir.asfaw/as-we-enter-the-fifth-week-of-our-challenges-at-10-academy-were-diving-into-an-exciting-new-623a307b8021?source=rss-763c5cf53bae------2</link>
            <guid isPermaLink="false">https://medium.com/p/623a307b8021</guid>
            <dc:creator><![CDATA[Ekram Kedir]]></dc:creator>
            <pubDate>Sat, 13 Jan 2024 17:26:59 GMT</pubDate>
            <atom:updated>2024-01-13T17:26:59.822Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*WSDhsdrsF0D5wL_z" /><figcaption>x</figcaption></figure><blockquote><strong><em>Revolutionizing Certificate Distribution: Building a Web3 dApp with Algorand</em></strong></blockquote><p>As we enter the fifth week of our challenges at 10 Academy, we’re diving into an exciting new mission. Our goal is to revolutionize how certificates are distributed and managed. The traditional method of using plain PDF files lacks the necessary features for verifying authenticity and enabling smart contract actions.</p><p>To achieve this transformation, we’ve partnered with Algorand, a leading blockchain platform known for its speed, efficiency, and scalability. This collaboration signifies our commitment to exploring innovative technologies and pushing the boundaries of what’s possible.</p><p>Join us on this journey as we navigate the world of blockchain, Web3 dApps, and smart contracts. Our aim is to create a future where certificates are more than static documents — they become dynamic entities, empowered by decentralized technologies. Welcome to the fifth-week challenge, where we set out to redefine certificate distribution with Algorand.</p><blockquote><strong>Algorand Blockchain: A Foundation for Innovation</strong></blockquote><p>Algorand is a blockchain platform renowned for its speed, efficiency, and scalability. As of now, it boasts a significant market capitalization and hosts a large number of user accounts. These factors contribute to its reputation as a robust and widely adopted blockchain solution.</p><p>Key Algorand Statistics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qqarU965DIKnUiOQ" /></figure><p>A static summary of algorand from June 2019 till September 17,2023 as shown in the header if you wanted to check it in detail here is the <a href="https://www.statista.com/statistics/1277849/algorand-daily-market-cap/">LINK</a>.</p><blockquote><strong>Technology Choices: Frontend and Backend Synergy</strong></blockquote><p>For the backend, Flask was selected, and React was chosen for the frontend to develop a robust and interactive Web3 dApp.</p><blockquote><strong>Implementation Journey</strong></blockquote><p><strong>Personalized Certificates with OpenAI API and CV2</strong></p><p>The journey started with the creation of personalized certificates using the OpenAI API and CV2. Following OpenAI guidelines, I personally crafted a normal white paper certificate background since the certificate backgrounds were too decorative so even being able to generate a blank page was requiring a lot of work on the prompt message. The dynamic insertion of details such as Full Name, Logo, Date, and more was accomplished using CV2, ensuring a personalized touch for each certificate.</p><p><strong>Sandbox &amp; API Connections: Building the Foundation</strong></p><p>Understanding the intricacies of Web3 technology, Blockchain, and Algorand was paramount. The groundwork involved setting up a GitHub repository, selecting suitable frontend and backend frameworks, and exploring Algorand dev features. Establishing connections to the Algorand testnet and querying account information marked pivotal milestones in this phase.</p><p><strong>Frontend &amp; Backend Development: Crafting the User Experience</strong></p><p>The frontend development journey kicked off with static data, enabling rapid validation of logic and wallet connections. Simultaneously, the backend, implemented with Flask and the Algorand Python SDK, took shape after a lot of challenging debugging hours. This included the creation of API endpoints crucial for NFT issuance, transfer approvals, and request tracking. Robust testing with PyTest.</p><p>Generally given the complexity of the backend work, progress in other areas has been limited especially in the new web3 technologies. Despite the challenges,I have been trying to tackle each and every task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*ubyQTdfw7tE6u71X" /></figure><blockquote><strong>Lessons Learned: Navigating Challenges</strong></blockquote><p>As a newcomer to the concepts of blockchain and Web3 posed its own set of challenges. The initial learning curve demanded dedicated effort, with approximately two days invested solely in grasping the foundational concepts. The challenges encountered included:</p><p><strong>Blockchain Fundamentals</strong>: A deep dive into blockchain principles, especially Algorand, was essential for seamless integration.</p><p><strong>Smart Contract Complexity</strong>: Implementing smart contracts and working with them required understanding of the concept and being familiar with the technology matrix.</p><p><strong>Wallet Integration</strong>: Integrating wallet-based authorization on the frontend required careful consideration and need for security best practices.How ever i have tried to have an authentication since the user when it creates an account it will automatically create the wallet and other things will be integrated to this concept.</p><blockquote><strong>Future Plans:</strong></blockquote><p>Looking ahead, the plan is to explore more about Web 3 technology and Algorand and also finalize my work till I feel confident with it since I have wasted too much time here. The goal is to work on various projects to get a better grasp of these concepts. The focus is on continuous learning and applying the knowledge gained in practical projects.</p><p>In conclusion, the journey of building a Web3 dApp with Algorand was transformative, aligning with the vision of decentralization and a user-controlled internet. The project not only addressed the immediate need for secure certificate distribution but also played a high role for future innovations in blockchain-based educational systems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=623a307b8021" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>