<?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 Eranda Sooriyarachchi on Medium]]></title>
        <description><![CDATA[Stories by Eranda Sooriyarachchi on Medium]]></description>
        <link>https://medium.com/@elsooriyarachchi?source=rss-c795cc2d322------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FlYl4Cszr5AGW7xrwYspOg@2x.jpeg</url>
            <title>Stories by Eranda Sooriyarachchi on Medium</title>
            <link>https://medium.com/@elsooriyarachchi?source=rss-c795cc2d322------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 15:35:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@elsooriyarachchi/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[Cyber Neighborhood: An Educational Cybersecurity Web App]]></title>
            <link>https://medium.com/@elsooriyarachchi/cyber-neighborhood-an-educational-cybersecurity-web-app-ebcf05703317?source=rss-c795cc2d322------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebcf05703317</guid>
            <category><![CDATA[cyberattack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <dc:creator><![CDATA[Eranda Sooriyarachchi]]></dc:creator>
            <pubDate>Mon, 12 Feb 2024 21:30:51 GMT</pubDate>
            <atom:updated>2024-02-12T21:30:51.223Z</atom:updated>
            <content:encoded><![CDATA[<p>You can visit the website at: <a href="https://cpre530.z19.web.core.windows.net/">https://cpre530.z19.web.core.windows.net</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*43f8ZiAd2IrYvw1bmJIpLQ.png" /><figcaption>Cyber Neighborhood Home page</figcaption></figure><p>Cybersecurity has become increasingly important with advancements in technology. As computers have become widely accessible to the general public, educating them about the implications of cyber threats is crucial. To address this need, Prathiksha and I have created an interactive web application, ‘The Cyber Neighborhood’. This platform educates the general public about different types of cyber-attacks using analogies that are familiar to those living in a typical neighborhood. We discuss the 4-layer TCP/IP model and associate each type of attack with its respective layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t9fOpn1yLZdG7NL1cCff9A.png" /><figcaption>TCP/IP model graphical representation in a Postal Service Analogy</figcaption></figure><p>The 4-layer TCP/IP model is initially explained through a postal service analogy, and a graphical representation of this analogy is used for easy comprehension. As users browse through the various layers of the model, they encounter two types of attacks that could occur at each layer, illustrated with visuals and analogies. To further enhance the learning experience, the website features a ‘knowledge check’ tab where users can study flashcards or take quizzes to test their knowledge. For added interest, fun facts about cybersecurity are provided at the bottom of the homepage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LkTMClD1D0KdueO2ruK61w.png" /><figcaption>Fun facts about cybersecurity on the Cyber Neighborhood Web App</figcaption></figure><p>The site was developed using JavaScript, CSS, and HTML, with graphical illustrations created in Adobe Illustrator. This static website is hosted through Azure Web Services. All the code for this website can be found on our GitHub page: <a href="https://github.com/prathiksha1107/cpre530finalproject/tree/main/cprefinalproject">https://github.com/prathiksha1107/cpre530finalproject/tree/main/cprefinalproject</a>.</p><p>The future direction of this web app includes adding more types of attacks and enhancing the graphics and knowledge testing features available to users. Additionally, integrating a method for receiving feedback from users will help us improve the quality of our service.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebcf05703317" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CropDoc: Multi-modal Retrieval Augmented Generation (RAG) AI Application using OpenAi and Pytorch]]></title>
            <link>https://medium.com/@elsooriyarachchi/cropdoc-multi-modal-retrieval-augmented-generation-rag-ai-application-using-openai-and-pytorch-91541f62c4a5?source=rss-c795cc2d322------2</link>
            <guid isPermaLink="false">https://medium.com/p/91541f62c4a5</guid>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[fastai]]></category>
            <category><![CDATA[image-classification]]></category>
            <category><![CDATA[langchain]]></category>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[Eranda Sooriyarachchi]]></dc:creator>
            <pubDate>Fri, 29 Sep 2023 05:03:55 GMT</pubDate>
            <atom:updated>2023-09-29T16:28:56.495Z</atom:updated>
            <content:encoded><![CDATA[<p>I participated in my first hackathon as a solo team, team no.17, in HackUIowa, which was held on September 23–24, 2023, in Iowa City, IA. I completed making the <a href="https://huggingface.co/spaces/elsoori/CropDocV1">CropDoc application </a>during this hackathon. You can find the DevPost submission <a href="https://devpost.com/software/cropdoc-iz5el8">here</a>.</p><p>I have lived in Iowa for a while now, so I wanted to make an AI app that would be useful to farmers in Iowa. Since Soybean is one of the top 2 crops in Iowa, I decided to make a deep-learning architecture that would classify Soybean diseases. When I stumbled upon a <a href="https://crops.extension.iastate.edu/files/article/PM1989.pdf">document</a> from Iowa State University about the six most common Soybean leaf diseases, I decided that it would be a good starting point for an image classifier. Hence, my first goal for this hackathon was to create an image classifier to diagnose soybean plants&#39; six most common leaf diseases. I didn’t want to stop at the image classifier, so I decided to be ambitious and add a chat function that would enable the users to ask questions about the crop diseases they are concerned about. Eventually, the CropDoc was made with an Image Classifier and a chabot you can ask questions from.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MXD0xnC2mPlRmgnE6jvUAA.png" /><figcaption>Figure 1. Architecture Diagram of the CropDoc</figcaption></figure><p><strong>Making the Image Classifier</strong></p><p>I recently started taking the <a href="https://course.fast.ai/">Fastai course</a> by Jeremy Howard, and I used strategies I have learned thus far to make this classifier. Fastai is a high-level framework over the Pytorch library for training deep learning models. I used Google Colab notebooks with a V100 GPU to run training of the image classifier.</p><p>The first step was to install all the packages used onto the Python environment of the Google Colab notebook.</p><pre>!pip install -Uqq fastai duckduckgo_search fastbook timm</pre><p>All the libraries required were then imported.</p><pre>from duckduckgo_search import ddg_images<br>from fastai.vision.all import *<br>import timm<br>from fastdownload import download_url<br>from time import sleep</pre><p>I scraped images for each of the six diseases from the Duckduckgo image search to produce the dataset.</p><pre>disease_types = &#39;Brown Spot&#39;,&#39;Bacterial Blight&#39;,........<br>path = Path(&#39;Soybean&#39;)<br><br>for o in disease_types:<br>    dest = (path/o)<br>    dest.mkdir(exist_ok=True, parents =True)<br>    download_images(dest, urls=search_images_ddg(f&#39;{o} in Soybean plant&#39;))<br>    sleep(1)<br>    resize_images(path/o, max_size=200, dest=path/o)</pre><p>Once the dataset was created using images downloaded from Duckduckgo, all the failed or corrupt images were then removed.</p><pre>failed = verify_images(get_image_files(path))<br>failed.map(Path.unlink)<br></pre><p>Now that the dataset was complete with verified images, the data was loaded in the DataLoaders object of Fastai. In the DataLoaders, 80% of the dataset is used as the training set, and 20% of the dataset is used as the validation set.</p><pre>Soybean = DataBlock(<br>    blocks=(ImageBlock, CategoryBlock),<br>    get_items=get_image_files,<br>    splitter=RandomSplitter(valid_pct=0.2, seed=42),<br>    get_y=parent_label,<br>    item_tfms=Resize(192))</pre><p>Next, I chose convnextv2_nano, a pre-trained image model from the <a href="https://timm.fast.ai/">timm</a>(Pytorch Image Models) library of Fastai, and fine-tuned it with the training set to classify the Soybean diseases.</p><pre><br>dls = Soybeans.dataloaders(path)<br>learn = vision_learner(dls,&#39;convnextv2_nano&#39;, metrics=error_rate).to_fp16()<br>learn.fine_tune(4)</pre><p>Once the model was trained, I performed data cleaning using the Fastai ImageClassifierCleaner, which enables you to select a category and the respective training or validation set and manage high-loss images for removal or relabeling in sequential order.</p><pre>cleaner = ImageClassifierCleaner(learn)<br>cleaner</pre><p>Once the images responsible for high loss are selected with the correct labels on the GUI of ImageClassifierClear, the image&#39;s relabeling or removal is done.</p><pre>for idx in cleaner.delete(): cleaner.fns[idx].unlink()<br>for idx,cat in cleaner.change():<br>  if not cleaner.fns[idx].exists():<br>      shutil.move(str(cleaner.fns[idx]), path/cat)</pre><p>Subsequently, I fine-tuned the model again, and the model.pkl file was then ready to be exported.</p><pre>learn.export(&#39;model.pkl&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m5tFsjIJ2DNm6CZjLWDWaw.png" /><figcaption>Figure 2. The User Interface of the Image Classifier /Disease Identifier of CropDoc</figcaption></figure><p><strong>Making the Chatbot</strong></p><p>A chatbot that utilizes only a large language model(LLM), such as OpenAI’s GPT 3.5, would only contain knowledge that was present when that model was created. However, that would be inadequate when you want to learn about the most up-to-date information. Because of this shortcoming, Retrieval Augment Generation(RAG), which retrieves from an updated knowledge base, such as Wikipedia, would provide information on diseases that were not known when the training corpus was created. <a href="https://python.langchain.com/docs/get_started/introduction">LangChain</a> is a framework that helps make applications utilizing LLM, such as <a href="https://python.langchain.com/docs/integrations/llms/openai">OpenAI GPT 3.5</a>, and also enables optimization of LLM-based systems using tools such as <a href="https://python.langchain.com/docs/integrations/document_loaders/wikipedia">Wikipedia for query searching.</a> Therefore, I decided to make use of the Langchain framework to make this chatbot, which uses a large language model optimized with retrieval augmented generation (LLM with RAG).</p><p>All the libraries required were imported.</p><pre>import os<br>from langchain.agents import load_tools, initialize_agent, AgentType<br>from langchain.llms import OpenAI<br></pre><p>The OpenAI API key was set.</p><pre>os.environ[&#39;OPENAI_API_KEY&#39;] = &#39;api key for openai gpt 3.5&#39;</pre><p>The OpenAI LLM with a temperature of zero was assigned to a variable called llm. Temperature is a parameter that influences the randomness of the model’s output. Since the temperature = 0, the output of the model is very deterministic.</p><pre>llm = OpenAI(temperature=0)</pre><p>The Wikipedia query search, which is responsible for the Retrieval Augmented Generation of this OpenAI chatbot, was loaded and assigned to the variable called tools.</p><pre>tools = load_tools([&quot;wikipedia&quot;])</pre><p>Finally, the Langchain chatbot agent was initialized with the llm and the tools.</p><pre>agent = initialize_agent(tools, llm, AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)</pre><p>Once these steps were completed, the OpenAI chatbot with RAG was ready to be utilized.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8iqmsKY6SKJ1wvfSgQqIEg.png" /><figcaption>Figure 3. The User Interface of the Chatbot with an example query and output</figcaption></figure><p><strong>Interface and Hosting</strong></p><p>The frontend of this application was made using Gradio, and it is hosted on Huggingface Spaces.</p><p>The video below is a brief demonstration of the app.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fe82cUetIHOM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3De82cUetIHOM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fe82cUetIHOM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b5d50c8e9b51bbea7cd9f0ee135a6282/href">https://medium.com/media/b5d50c8e9b51bbea7cd9f0ee135a6282/href</a></iframe><p>Please find all you need to recreate this project in my <a href="https://github.com/elsoori/CropDoc">GitHub repository</a> and <a href="https://huggingface.co/spaces/elsoori/CropDocV1/tree/main">Huggingface Spaces repo</a>.</p><p><strong>Future Direction</strong></p><p>Moving forward, I would like to incorporate a zero-shot image classifier as the first level of image classification so that I can exclude all invalid images, such as all non-plant images, from being classified. I would also like to make a larger and cleaner dataset and use a bigger model to classify the diseases. Finally, I would expand the model to cover all soybean diseases and subsequently expand to include more crops.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91541f62c4a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>