<?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 Ridadogrul on Medium]]></title>
        <description><![CDATA[Stories by Ridadogrul on Medium]]></description>
        <link>https://medium.com/@ridadogrul13?source=rss-6579d4b5dc6c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*x6BifHAyHl8_VmSj-zT6cQ.jpeg</url>
            <title>Stories by Ridadogrul on Medium</title>
            <link>https://medium.com/@ridadogrul13?source=rss-6579d4b5dc6c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 21:28:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ridadogrul13/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[AI Agents: The Shift from Monolithic Models to Compound Systems]]></title>
            <link>https://pub.aimind.so/ai-agents-the-shift-from-monolithic-models-to-compound-systems-bb8e09178a31?source=rss-6579d4b5dc6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb8e09178a31</guid>
            <category><![CDATA[ai-agents-review]]></category>
            <dc:creator><![CDATA[Ridadogrul]]></dc:creator>
            <pubDate>Tue, 13 Jan 2026 10:24:22 GMT</pubDate>
            <atom:updated>2026-01-14T14:27:43.587Z</atom:updated>
            <content:encoded><![CDATA[<p>An exciting transformation is happening in the world of artificial intelligence: <strong>the shift from monolithic models to compound AI systems</strong>. So what exactly are AI agents, and why are they so important? Let’s explore together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xz7Jr0dd3ImbzCKhjhWvfQ.jpeg" /></figure><h3>The Limitations of Models</h3><p>AI models on their own are limited by the data they’ve been trained on. This affects both what they know about the world and the types of tasks they can solve. They’re also hard to adapt — tuning a model requires significant investment in data and resources.</p><p>Let me explain with a simple example: I want to plan a vacation for this summer, and I need to know how many vacation days I have available. If I feed this query directly into a model, I’ll likely get an incorrect answer. Why? Because the model doesn’t know who I am and doesn’t have access to my personal information.</p><p>Of course, models are useful for many tasks — summarizing documents, creating email drafts, and more. But <strong>the real magic happens when we build systems around the model and integrate it into our existing processes</strong>.</p><h3>Compound AI Systems</h3><p>Let’s think about a system designed to solve this problem: I need to give the model access to the database where my vacation data is stored. When I feed the same query to the model, this time it creates a search query, retrieves information from the database, and generates a correct answer like “Rida, you have 10 days left in your vacation balance.”</p><p><strong>This is an example of a compound AI system</strong>, recognizing that certain problems are better solved when we apply the principles of system design.</p><h3>Advantages of the System Approach</h3><p>When we say “system,” we mean multiple components working together:</p><ul><li><strong>Modularity:</strong> I can choose between tuned models, large language models, image generation models</li><li><strong>Programmatic components:</strong> Output verifiers, query decomposers</li><li><strong>Tools and integrations:</strong> Database searches, various tool combinations</li></ul><p>This approach is inherently easier and faster to adapt than tuning a model.</p><h3>The Rise of Agentic Systems</h3><p>The example above and most RAG (Retrieval Augmented Generation) systems have a limitation: the control logic is programmatic and fixed. If I ask about the weather in a system designed to query my vacation policy database, it will fail because it always follows the same path.</p><p><strong>So where do agents come in?</strong></p><p>Thanks to tremendous improvements in the reasoning capabilities of large language models, we can now put a language model in charge of the control logic. These models can break down complex problems and plan how to solve them.</p><h3>The Thinking Spectrum</h3><p>We can think of two extremes:</p><p><strong>Think fast:</strong> We tell the system “think fast, act as programmed, don’t deviate from the instructions I’ve given you.”</p><p><strong>Think slow:</strong> We tell the system “create a plan, tackle each part of the plan, see where you get stuck, readjust if necessary.” When you’re asked a complex question, the first answer that comes to mind is probably wrong. But if you break down the problem and identify which parts need external help, your chances of success increase significantly.</p><p><strong>When we put LLMs in charge of the logic, we’re talking about an agentic approach.</strong></p><h3>Capabilities of LLM Agents</h3><h3>1. Reasoning</h3><p>The model is at the core of how problems are solved. It’s prompted to come up with a plan and reason about each step of the process.</p><h3>2. Action</h3><p>This is accomplished through external programs known in the industry as <strong>tools</strong>:</p><ul><li>Web search or database queries</li><li>Calculator (for mathematical operations)</li><li>Database manipulation programs</li><li>Another language model for translation tasks</li><li>APIs and more</li></ul><h3>3. Memory</h3><p>We can talk about two types of memory:</p><ul><li>The model’s thinking process logs (like thinking out loud while solving a problem)</li><li>Conversation history between the user and agent (for personalized experiences)</li></ul><h3>ReACT: A Popular Approach</h3><p>One of the most popular ways of configuring agents is <strong>ReACT</strong> (Reasoning + Action), which combines the reasoning and action components of LLM agents.</p><p>Here’s how a ReACT agent works:</p><ol><li><strong>User query</strong> is fed into the model</li><li>The model is instructed to <strong>think slow</strong>: “Don’t give me the first answer that pops into your head, plan your work”</li><li>The model decides whether to use <strong>external tools</strong></li><li>A tool call is made and the answer is <strong>observed</strong></li><li>If the answer is sufficient, it’s done; otherwise, the plan is <strong>reevaluated</strong></li><li><strong>Iteration</strong> continues until a final answer is reached</li></ol><h3>Real-World Example: Vacation Planning</h3><p>Let’s ask a complex question: “I’m planning to go to Marmaris next month. I’ll be outdoors a lot and I’m prone to burning. How many 2-ounce sunscreen bottles should I bring?”</p><p>This is a complex problem. The agent needs to:</p><ol><li><strong>Check memory:</strong> How many vacation days am I planning to take (maybe I asked this before)</li><li><strong>Weather research:</strong> Average sun hours expected in Marmaris next month</li><li><strong>Health information:</strong> Recommended sunscreen dosage per hour in the sun (from public health websites)</li><li><strong>Mathematics:</strong> Calculate how much sunscreen fits into 2-ounce bottles</li></ol><p>What’s powerful here: <strong>There are many paths that can be explored to solve a problem.</strong> This makes the system quite modular and capable of handling much more complex problems.</p><h3>Which Approach When?</h3><p>Compound AI systems are here to stay. What we’ll observe this year is that <strong>they’re becoming more agentic</strong>. Think of it as a sliding scale of AI autonomy:</p><h3>Programmatic Approach (Narrow Problems)</h3><ul><li>For well-defined, narrow problem sets</li><li>Every query is answered the same way</li><li>More efficient — no unnecessary looping and iteration</li><li>Example: Only vacation policy queries</li></ul><h3>Agentic Approach (Broad Problems)</h3><ul><li>For very complex tasks (e.g., solving GitHub issues independently)</li><li>For handling a wide spectrum of queries</li><li>Manually configuring every path would be too much effort</li><li>More flexibility and adaptation</li></ul><h3>Conclusion</h3><p>We’re still in the <strong>early days of agent systems</strong>. We’re seeing rapid progress when combining system design with agentic behavior. In most cases, there will be a human in the loop as accuracy improves.</p><p>The future of AI doesn’t lie in powerful standalone models alone, but in <strong>intelligently designed systems and autonomous agents</strong>. This transformation may be the key to unlocking AI’s true potential.</p><h4>A Message from AI Mind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*5Wm7sOfTpe5DEbhg.gif" /></figure><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://pub.aimind.so/">AI Mind Publication</a></li><li>🧠 Improve your <a href="https://www.aimind.so/prompt-generator?utm_source=pub&amp;utm_medium=message">AI prompts effortlessly and FREE</a></li><li><strong>🧰 Discover </strong><a href="https://www.aimind.so/?utm_source=pub&amp;utm_medium=message"><strong>Intuitive AI Tools</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb8e09178a31" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/ai-agents-the-shift-from-monolithic-models-to-compound-systems-bb8e09178a31">AI Agents: The Shift from Monolithic Models to Compound Systems</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring LLMs, PEFT, LoRA, and QLoRA: Advancements in Efficient Model Training]]></title>
            <link>https://pub.aimind.so/exploring-llms-peft-lora-and-qlora-advancements-in-efficient-model-training-f7e2be739638?source=rss-6579d4b5dc6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7e2be739638</guid>
            <category><![CDATA[lora]]></category>
            <category><![CDATA[qlora]]></category>
            <category><![CDATA[peft]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[fine-tuning]]></category>
            <dc:creator><![CDATA[Ridadogrul]]></dc:creator>
            <pubDate>Mon, 09 Sep 2024 14:20:35 GMT</pubDate>
            <atom:updated>2024-09-09T17:47:53.562Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is LLM (Large Language Model)?</h3><p>LLM (Large Language Models) are deep learning models that are capable of understanding, producing and interpreting natural language by processing large amounts of data. These models are trained with millions or billions of parameters and learn the structural features of the language. Models such as GPT-3 and GPT-4 are trained on very large amounts of text and can perform many language processing tasks. LLMs usually use Transformer architecture and learn the contexts in the language by performing many matrix operations between layers.</p><p>In Transformer-based models, each layer consists of a set of dense weight matrices. These weights are the parameters that the model learns from the training data. However, as the models grow (for example, GPT-3 with 175 billion parameters), updating and fine-tuning these parameters becomes very expensive, so we use smaller models in production environments. On the other hand, smaller models cannot be generalized to more than one task and we have more than one model for more than one task of more than one user. This is where PEFT techniques like LoRA come into play, allowing you to train large models much more efficiently than completely fine-tuning them.</p><h3>What is PEFT Finetuning?</h3><p>PEFT Finetuning is Parameter Efficient Fine Tuning, a set of fine-tuning techniques that allows you to fine-tune and train models much more efficiently than normal training. PEFT techniques usually work by reducing the number of trainable parameters in a neural network.</p><h3>Why use PEFT Finetuning?</h3><p>Saves time. As the number of trainable parameters decreases, you need to spend less time on training. With fewer trainable parameters, you can train models much faster and as a result, test models much faster. ‍</p><p>Due to memory-intensive optimizations, you don’t need to rent instances with large amounts of VRAM because you can fit larger batches into smaller VRAMs. This saves money on computation and allows you to train on much larger datasets by taking advantage of larger batch sizes.</p><p>Easily build Multi-Tenancy architecture services. If you have multiple users, you can take on the complex task of fine-tuning a new model for each new user, or fine-tuning the same model for a new user on new data. Both approaches have their own problems, if you fine-tune a new model for each user, it will lead to better accuracy, but then you have to deal with large models, load them into memory, store them, process them, etc. It is much easier to train the same model for all users, but then the model accuracy drops significantly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WDpTBnCIseLJYgAx.png" /></figure><p>PEFT fine-tuning takes the best of both worlds and allows you to create small adapters that you can match with models and get customized results. These adapters can be fine-tuned for specific datasets or specific users. These adapters are quite small, 6MB-8MB, and you only need to apply these adapters to the large model, which is much faster in a production environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y3t-Vn9nIj9zTi-3.png" /></figure><h3>What is LoRA?</h3><p>LoRA (Low-Rank Adaptation) is a method developed to make fine-tuning of large language models (LLM) more efficient. Traditional fine-tuning methods increase memory and computational costs by updating all parameters of the model. Instead of updating the parameters of large models, LoRA optimizes the computation by representing the changes in these parameters with low-rank matrices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*vCJz18kapBJkPv_8.png" /></figure><h3>Working Logic of LoRA</h3><p>Instead of directly updating the weight matrices in large models (for example, in Transformer layers), LoRA expresses the changes in these matrices with low-rank matrices. For example, let’s say the hidden layer size of a model is 2,048 and the vocabulary size is 30,000. In this case, the output weight matrix will be as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*GkjUxeR2jQoJmR9s5xz21g.png" /></figure><p>Updating such a large weight matrix is ​​very costly, both in terms of memory and computation. To solve this problem, LoRA represents changes in the weight matrix by multiplying two smaller matrices:</p><p>Matrix A is a matrix of size 2,048×R.<br>Matrix B is another matrix of size R×30,000.</p><p>Here, RR is a hyperparameter that determines the degree of low-rank decomposition. Using the product of these two matrices, LoRA calculates the parameters that need to be updated:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/215/1*KHdwhV_5rlMUC8JLAO3k5Q.png" /></figure><p>In this way, the number of parameters that need to be updated is:<br>LoRA parameter count=(2,048×R)+(R×30,000)=2,048R+30,000R</p><p>If we choose R as 16, the total number of parameters that need to be updated is:<br>2,048×16+16×30,000=32,768+480,000=512,768 parameters</p><p>That is, instead of 61,440,000 parameters, only 512,768 parameters need to be updated. This allows fine-tuning the model with approximately 120 times fewer parameters.</p><h3>LoRA finetuning with HuggingFace</h3><p>To implement LoRA finetuning with HuggingFace, you need to use the <a href="https://pypi.org/project/peft/">PEFT library</a> to inject the LoRA adapters into the model and use them as the update matrices.</p><pre>from transformers import AutoModelForCausalLM<br>from peft import get_peft_config, get_peft_model, LoraConfig, TaskType</pre><pre>model = AutoModelForCausalLM.from_pretrained(model_name_or_path, device_map=&quot;auto&quot;, trust_remote_code=True) </pre><pre>peft_config = LoraConfig(<br>    task_type=TaskType.CAUSAL_LM, inference_mode=False, r=32, lora_alpha=16, lora_dropout=0.1,<br>    target_modules=[&#39;query_key_value&#39;] <br>) </pre><pre>model = get_peft_model(model, peft_config) </pre><pre>model.print_trainable_parameters() <br></pre><p>‍</p><p>Once this is done, you can train the model as you would normally do. But this time it will take much less time and compute resources as it normally does.</p><h3>What is QLoRA?</h3><p>QLoRA (Quantized Low-Rank Adaptation) is a technique that goes one step beyond LoRA and uses quantization techniques as well as low-rank matrices. Quantization allows model parameters to be represented in lower bit numbers, which further reduces both memory usage and computational costs.</p><p>In addition to the advantages of LoRA, QLoRA allows parameters to be stored more compactly with low-bit quantization. For example, parameters represented in 8-bit or lower bits instead of 16-bits reduce the memory usage of the model by half. Thanks to quantization, the space occupied by the model in memory is even smaller, while there is very little loss in performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QB7sI0NcBgumFKvc.png" /></figure><h3>QLoRA’s Working Logic</h3><p>QLoRA further optimizes the low-dimensional matrix decomposition done in LoRA. As in LoRA, updates are made with low-dimensional matrices instead of all the parameters in the model, but these matrices are stored at 4-bit or 8-bit resolution instead of 32-bit. For example, if we update LoRA with 512,768 parameters using 8-bit quantization, the memory requirement is halved, allowing much larger models to be run efficiently even on smaller hardware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xkdhYzAT3GX7Eb0L.png" /></figure><h3>How is QLoRA different from LoRA?</h3><p>QLoRA and LoRA both are finetuning techniques, but QLoRA uses LoRA as an accessory to fix the errors introduced during the quantization errors. LoRA in itself is more of a standalone finetuning technique.</p><h3>QLoRA finetuning with HuggingFace</h3><p>To do QLoRA finetuning with HuggingFace, you need to install both the <a href="https://pypi.org/project/bitsandbytes/">BitsandBytes library</a> and the PEFT library. The BitsandBytes library takes care of the 4-bit quantization and the whole low-precision storage and high-precision compute part. The PEFT library will be used for the LoRA finetuning part.</p><p>‍</p><pre>import torch<br>from peft import prepare_model_for_kbit_training, LoraConfig, get_peft_model<br>from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig</pre><pre>model_id = &quot;EleutherAI/gpt-neox-20b&quot;<br>bnb_config = BitsAndBytesConfig(<br>    load_in_8bit=True,<br>    bnb_8bit_use_double_quant=True,<br>    bnb_8bit_quant_type=&quot;int8&quot;,<br>    bnb_8bit_compute_dtype=torch.bfloat16<br>) </pre><pre>model = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=bnb_config, device_map={&quot;&quot;:0})</pre><pre>model.gradient_checkpointing_enable()<br>model = prepare_model_for_kbit_training(model) </pre><pre>config = LoraConfig(<br>    r=8, <br>    lora_alpha=32, <br>    target_modules=[&quot;query_key_value&quot;], <br>    lora_dropout=0.05, <br>    bias=&quot;none&quot;, <br>    task_type=&quot;CAUSAL_LM&quot;<br>)</pre><pre>model = get_peft_model(model, config) </pre><p>References:</p><p>Lora Paper: <a href="https://www.youtube.com/redirect?event=video_description&amp;redir_token=QUFFLUhqbFlycHFsRGdjR01jUDFWVTZnMXVfWmxadkpjd3xBQ3Jtc0trUkJVTXZoSGVwUWNqaVRZWXRFaFQwTFRudXpJRVFvMkh2bkw5akxaVV85em9hcUNjb3Q0SjFqMnFXeHBiRWo4MmU3UHUtSlV2elZYSm9yLUd2SUhuV2xzd2Vob2IycVhLUDNRNWFsZG9IYlBsVVFiaw&amp;q=https%3A%2F%2Farxiv.org%2Fabs%2F2106.09685&amp;v=Hw6E6YA8S3Y">https://arxiv.org/abs/2106.09685</a></p><p>QLora Paper: <a href="https://www.youtube.com/redirect?event=video_description&amp;redir_token=QUFFLUhqbktqbGNaVUtTNi1qSzRyZjk1eE9fVU5QU3JJQXxBQ3Jtc0tsSGxGd3VQNkR0cWk1MlQxUWdzbzF1bGVDM3BsNDhVWG1BUUlYVGE4UWFWM1p6TTBVQkhlRWN1SGNwQzNIZERha3djNXE0WkpFVEw1UllxMkd6RFRWZEw1RF9fbThRUlVGaHdsaDRoR3lESzhEalJqdw&amp;q=https%3A%2F%2Farxiv.org%2Fpdf%2F2305.14314.pdf&amp;v=Hw6E6YA8S3Y">https://arxiv.org/pdf/2305.14314.pdf</a></p><p><a href="https://www.mercity.ai/blog-post/guide-to-fine-tuning-llms-with-lora-and-qlora">https://www.mercity.ai/blog-post/guide-to-fine-tuning-llms-with-lora-and-qlora</a></p><h4>A Message from AI Mind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*5Wm7sOfTpe5DEbhg.gif" /></figure><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://pub.aimind.so/">AI Mind Publication</a></li><li>🧠 Improve your <a href="https://www.aimind.so/prompt-generator?utm_source=pub&amp;utm_medium=message">AI prompts effortlessly and FREE</a></li><li><strong>🧰 Discover </strong><a href="https://www.aimind.so/?utm_source=pub&amp;utm_medium=message"><strong>Intuitive AI Tools</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7e2be739638" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/exploring-llms-peft-lora-and-qlora-advancements-in-efficient-model-training-f7e2be739638">Exploring LLMs, PEFT, LoRA, and QLoRA: Advancements in Efficient Model Training</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Performance Improvement Methods in Deep Learning Applications (Regularization)]]></title>
            <link>https://pub.aimind.so/performance-improvement-methods-in-deep-learning-applications-regularization-890243443466?source=rss-6579d4b5dc6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/890243443466</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[regulation]]></category>
            <category><![CDATA[dropout-layer]]></category>
            <category><![CDATA[early-stopping]]></category>
            <dc:creator><![CDATA[Ridadogrul]]></dc:creator>
            <pubDate>Mon, 29 Jul 2024 11:39:55 GMT</pubDate>
            <atom:updated>2024-07-29T13:53:30.211Z</atom:updated>
            <content:encoded><![CDATA[<p>When we try to solve any problem with machine learning methods, we do not have clear information at the beginning about whether the data set we have is sufficient to create a good model; we do not know exactly whether the model we will create will lead us to overfitting or underfitting. However, we have preliminary information that the performance of the model can be increased by applying certain improvement methods. Therefore, we can think of performance improvement methods as an external parameter that increases the performance of the model, independent of the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*4G5V2eq1Z45vb4Tln6CnkA.png" /></figure><p>As can be seen in the simple artificial neural network model above, the performance improvement/regularization process can be defined as the process of calculating the “w” weights in the model in a way that will solve the problem more appropriately by adding an independent parameter to the cost function in the form of y=f(x.w)+b, where the performance of the model is measured. In this sense, it can be said that regularization is actually an independent parameter added to the loss function.</p><p>Only the “w” weights are affected by the regulation operations applied to the cost function y=f(x.w)+b, and no regulation is performed on the “b” bias values.</p><p>Regularization techniques are generally used to increase performance by preventing overfitting in the designed model. In addition, there are cases where they are used to reduce the complexity of the model without decreasing performance. Designing a simpler, smaller model while maintaining the same performance rate is generally important in places where resources (processor power, memory, etc.) are limited, such as mobile environments. If the model you develop will work in a mobile environment, you definitely need to make some improvements compared to desktop or web environments. We all have limited resources in mobile environments, such as battery, memory, and processor.</p><p>Now let’s explain the commonly used regulation techniques.</p><h3><strong>Dataset augmentation</strong></h3><p>The more data we have, the better the model will learn; this is a known fact. Good learning will also bring high performance. Having more data will not only increase model performance but also prevent overfitting. In cases where the size of the data is small, the first method used to increase the dataset is to produce synthetic data.</p><p>Producing Synthetic Data:</p><p>There is no universal method that everyone agrees on to produce synthetic data or increase the size of the dataset. However, there is a general principle followed in this regard;</p><p>“The dataset we have should reflect the complexity of the problem in the real world as much as possible.”</p><p>The more we can adapt the dataset to this principle, the more the performance will increase. In this sense, the presence of different versions of the data in the dataset will increase the compliance of the dataset with the principle. Therefore, by including different variations of the data and different sized views in the dataset, the size of the dataset is increased in a way that will increase the performance. Synthetic data generation is frequently used especially in image and voice recognition problems and is known to increase the performance.</p><p>Although increasing the size of the data set with synthetic data prevents overfitting to a certain extent, it is generally insufficient. Because the synthetic data created will continue to maintain its correlation with the existing data set even if there is a certain amount of variation. For this reason, the data set augmentation method is generally used together with other regularization methods.</p><h3><strong>Inject random negative</strong></h3><p>The process of adding noise is done in four ways in the model;</p><p>adding noise to inputs, adding noise to hidden layers, adding noise to weights and, adding noise as a parameter to the loss function.</p><p>Noisy data is created by manipulating the data in the existing data set and passing it through filters. This new data is added to the data set and used in training the model. Thus, the size of the data set is increased and the performance is relatively increased. This method is also an example of dataset augmentation explained in the previous section.</p><p>Adding noise to the hidden layers of the model is done with the dropout method, which will be explained in the following sections. Adding noise to the hidden layer similarly increases the performance of the model and prevents overfitting. Adding noise to the hidden layer is known to be more effective in terms of model performance than the parameter sharing method, which is another method that allows manipulation of the hidden layers.</p><p>By adding noise to the weights in the model, improvements can be made to the performance of the model. This technique is generally used in Recurrent Neural Network (RNN).</p><p>It is natural to have incorrectly labeled data in a dataset. Most datasets have some error in the y labels. This will maximize the function log p(y | x), which calculates the error when y is incorrect. Naturally, the model will be affected by this situation. One way to prevent this is to introduce noise into the model on the labels. For example, for a small constant e, we can assume that the training set is correct with probability 1-e and that any of the other possible labels could also be correct. This assumption means analytically incorporating noise into the cost function rather than explicitly drawing noise samples.</p><h3><strong>Dropout Layer</strong></h3><p>It was first proposed in the 2014 article Dropout: A Simple Way to Prevent Neural Networks from Overfitting. In short, it is a technique of removing certain nodes from the hidden or input layer according to a certain rule (using a threshold value or randomly). For example, as can be seen in the figure below, when dropout is applied to a network model where the threshold value is set as 0.5, the number of nodes in the hidden layer where dropout is applied is halved in the next layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*mWk5WUiAGmqdhIwMJkQOqQ.png" /></figure><p>The dropout technique is generally used after fully connected layers. Using dropout, the connections in fully connected layers are broken. Thus, nodes have less information about each other and as a natural result, nodes are less affected by each other’s weight changes. For this reason, more consistent (robust) models can be created with the dropout method. At the same time, since different hidden unit combinations work with each other in each layer, better learning will occur. In this sense, when dropout is used, it can be thought that hidden layers work as an ensemble like a random forest. This situation will provide better performance for the model in terms of both time and performance. As can be seen in the sample performance graphs below for cases where dropout is used and not used, overfitting decreased after dropout and the performance of the model increased. The dropout method is one of the most frequently used regularization methods in deep learning methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*emnIQZVxun0dTMAGL9wH1Q.png" /></figure><h3>Dense-sparse-dense training</h3><p>It was put forward in 2016 in the article titled DSD: Regularizing Deep Neural Networks with Dense-Sparse-Dense Training Flow. It was tested on problems in different areas such as NLP and vision and it was observed that it gave good results. It performs the operation performed in a single fully connected layer by dividing it into three layers as dense -&gt; sparse -&gt; dense. In this way, the effect of the weights on each other is reduced at first and then a connection is established between them to ensure that new information is learned. In this case, it prevents the overfitting problem caused by detailed learning. Using sparse at the beginning of the network structure and fully connected towards the end gives more efficient results. Since less memory is used in sparse networks, matrix multiplication operations will be performed faster. In this sense, Dense-Sparse-Dense networks are used to improve the model in terms of both speed and performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*6u_Ab8UX4oEhUEORG-7emA.png" /></figure><p><strong>Algorithm</strong>:</p><p><strong>Dense</strong>: Learn as dense. The goal is to determine which weights are important, not to reach the final weights.<br><strong>Sparse</strong>: Delete the weights below a certain threshold with dropout and make the model sparse. Retrain the model. Thus, learn the important connections.<br><strong>Dense</strong>: Retrain the model with a small learning rate and make the network dense again. Learn new information.</p><h3>Early Stoping</h3><p><strong>Validation Dataset:</strong> Validation set is the representation of the test data set during learning. It is selected from the training set but is not used during optimization. It is used to update the parameters with backprobagation. Therefore, it directly affects the learning process. At the end of each iteration (epoch), the performance of the model is measured separately with the validation set and the test set. While the result obtained with the validation set is used in the backprobagation process, the result of the test data set is not used in any step of the learning process. The test data set is a completely independent test set that measures the performance of the model step by step during the learning process. In contrast, the validation set is renewed as a different part of the training set in each iteration and directly contributes to the learning process of the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*mbwojuf2avgHPtMtAlFgTw.png" /></figure><p>Early Stopping: When the difference between validation loss and test loss starts to increase during learning, it means that the model is memorizing (overfitting) or learning the noise (noisy). In this case, when the validation error starts to increase, the training is stopped and the previous step is returned to. In order to return to the previous step, the data of the previous step must be stored in each learning step (epoch) during training. As can be seen in the graph below, both training error and test error decrease together at the beginning of learning. However, we see that the test error increases after the step indicated by the dashed line in the example, at this point memorization has occurred and learning should be stopped before this step. Changes on the weights after the overfitting process will negatively affect the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*bhZVTCv7qyDWrI-uoThbDg.png" /></figure><p>If you look at the sample performance graph where the blue line shows the wrong prediction rate for the training dataset and the red line shows the wrong prediction rate for the test dataset, you can see that the test and training error rate gradually decreases, that is, the model performance gradually increases, however, after the dashed line, the error prediction rate for the training dataset continues to decrease, whereas this rate increases for the test dataset. At this point, where this distinction occurs, it means that the model has started to memorize the training dataset (overfitting), at this point the model’s training should be stopped (early stopping).</p><h3>Parameter Norm (Weight) Penalty L1 ve L2</h3><p>Different weight vectors within the model can give the same performance. For example, let’s assume that the input vector is the matrix x = [1,1,1,1] in a model with a cost function defined as f = x.w + b. Let’s have two weight vectors as w1 = [1,0,0,0], w2 = [0.25,0.25,0.25,0.25]. In this case, f1 = w1.x = 1 and f2 = w2.x = 1 are calculated and the result of the multiplication of both matrices is the same. In other words, there can be more than one different weight vector that produces the same cost value for the input value x. In this case, which weight vector should be preferred? The working logic in model improvement is based on the assumption that the model with small weight values ​​is simpler and more interpretable than the model with large weights. For this reason, preferring low-value weights instead of weights that produce large values ​​will increase performance and prevent memorization. For this purpose, the weights of the model are tried to be kept at zero or near zero values ​​by using penalty functions. L1 and L2 functions are commonly used for the penalty process.</p><p>When we apply L2 to the cost function above, it will give the value f1 = w1.x = 1.0 and f2 = w2.x = 0.25. The w2 vector will be preferred because it produces a lower loss value compared to L2. Here, the fact that w2 has a lower L2 value is due to the fact that w2 consists of weights with smaller values ​​compared to w1 and that these weights have a normal distribution within the vector. As can be seen in the figure below, where the value histogram of the weights is given, when L2 is applied, the weights with a normal distribution continue to exist compared to the case when L1 is applied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*r2Ii9EgIR_oCsPbvs7IH5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*Qm2FTkY-UZbMPOjQbETiAQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*HwyfRBwPhLm72ujqForV8g.png" /></figure><p>L1 and L2 are generally used as the loss function of the model. In this sense, using L1 or L2 is one of the most well-known and standard regularization methods. However, different loss functions such as SVM and Softmax can be used for the model.</p><p><strong>L1 Manhatten distance:</strong></p><p>In this method, the penalty is made according to the absolute value of the weight. This method tends to make some values ​​zero. Therefore, it is prone to pruning / producing sparcity in the model. It also allows some values ​​to remain large. L1 provides the relevant value transformations using the formula given above.</p><p><strong>L2 Eucledean distance:</strong></p><p>In this method, the penalty is done according to the square of the weight value. It tends to take all weights to smaller values, close to zero. L2 provides the relevant value transformations using the formula given above.</p><h3>Finetuning</h3><p>The situation where a model is trained for a data set and then trained a little more for a different data set is called finetuning. The aim of this method is to build a new model on models at a certain level that have learned a certain subject well and to benefit from the knowledge of the previous model. Instead of starting the parameters of the model randomly, starting it with the weights of a problem in a similar domain increases the performance of the model. There are even studies that say that instead of starting it randomly, starting it with the weights of independent networks increases the performance.</p><p><strong>Other methods:</strong></p><p>Other frequently used methods for regularization include;<br>Transfer Learning<br>Multi-tasking Learning<br>Semi-Supervised Learning<br>Bagging (boostrap aggregation)<br>Ensemble models techniques.</p><p><strong>References</strong></p><p>[1] Cristina Scheau, Regularization in deep learning, <a href="https://chatbotslife.com/regularization-in-deep-learning-f649a45d6e0">https://chatbotslife.com/regularization-in-deep-learning-f649a45d6e0</a></p><p>[2] <a href="https://codelabs.developers.google.com/codelabs/cloud-tensorflow-mnist/#12">https://codelabs.developers.google.com/codelabs/cloud-tensorflow-mnist/#12</a></p><h4>A Message from AI Mind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*5Wm7sOfTpe5DEbhg.gif" /></figure><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://pub.aimind.so/">AI Mind Publication</a></li><li>🧠 Improve your <a href="https://www.aimind.so/prompt-generator?utm_source=pub&amp;utm_medium=message">AI prompts effortlessly and FREE</a></li><li><strong>🧰 Discover </strong><a href="https://www.aimind.so/?utm_source=pub&amp;utm_medium=message"><strong>Intuitive AI Tools</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=890243443466" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/performance-improvement-methods-in-deep-learning-applications-regularization-890243443466">Performance Improvement Methods in Deep Learning Applications (Regularization)</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding CPU Threading and TorchScript Inference in PyTorch]]></title>
            <link>https://pub.aimind.so/understanding-cpu-threading-and-torchscript-inference-in-pytorch-ee493ba117ab?source=rss-6579d4b5dc6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee493ba117ab</guid>
            <category><![CDATA[cpu]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[torchscript]]></category>
            <dc:creator><![CDATA[Ridadogrul]]></dc:creator>
            <pubDate>Mon, 27 May 2024 13:04:46 GMT</pubDate>
            <atom:updated>2024-05-28T13:19:32.320Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, we’ll explore how CPU threading and TorchScript inference work in PyTorch, emphasizing their significance in the field of artificial intelligence (AI).</p><h4>What is PyTorch?</h4><p>PyTorch is an open-source machine learning library widely used for developing and training AI models, particularly in deep learning. PyTorch is known for its flexibility and dynamic computation graph, which makes it ideal for both research and production. Its intuitive design allows developers and researchers to easily experiment and iterate on AI models.</p><h4>What is TorchScript?</h4><p>TorchScript is a way to serialize and optimize PyTorch models, enabling them to run independently from Python. This feature is crucial for deploying models in production environments where Python might not be available or practical. TorchScript is supported by PyTorch’s Just-In-Time (JIT) compiler, which allows models to be converted into a format that can be executed in a C++ runtime, among other environments.</p><h4>What is Inference in AI?</h4><p>Inference in AI refers to the process of using a trained model to make predictions or decisions based on new data. In the context of PyTorch, inference involves running a model on input data to produce meaningful outputs. This is a critical phase in the AI lifecycle, as it is when the model’s learned knowledge is applied to real-world problems, such as classifying images, detecting objects, or predicting stock prices.</p><h4>What is CPU Threading?</h4><p>CPU threading is a technique that allows different parts of a program to execute concurrently by dividing the process into multiple threads. By utilizing multiple threads, a CPU can handle several tasks simultaneously, improving performance and efficiency. This is particularly important in AI, where processing large datasets and complex models can be computationally intensive.</p><p>PyTorch allows using multiple CPU threads during TorchScript model inference. The following figure shows different levels of parallelism one would find in a typical application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*NhV0Emu8nkHHqWt_PpbGYQ.png" /></figure><h3>Using CPU Threading in PyTorch for AI</h3><p>PyTorch leverages CPU threading to accelerate the execution of operations, which is crucial for handling the demanding computations required in AI. Proper thread management and optimizations can significantly enhance the performance of AI models, especially during the inference phase.</p><h4>Thread Pool</h4><p>PyTorch uses a thread pool to manage threads efficiently. A thread pool consists of a collection of reusable threads that can execute specific tasks. This reduces the overhead associated with creating and destroying threads, making the execution of AI models more efficient.</p><p><strong>Example Code: Using a Thread Pool</strong></p><pre>import torch<br><br># Set the number of PyTorch threads<br>torch.set_num_threads(4)<br><br># Simple matrix multiplication, common in AI models<br>a = torch.randn(1000, 1000)<br>b = torch.randn(1000, 1000)<br>c = torch.matmul(a, b)</pre><h4>Using OpenMP and Intel MKL</h4><p>PyTorch utilizes libraries such as OpenMP and Intel Math Kernel Library (MKL) to handle threading and optimize performance. These libraries are designed to efficiently perform high-performance mathematical operations, which are integral to AI tasks.</p><h4>Thread Affinity</h4><p>Thread affinity in PyTorch ensures that threads are bound to specific CPU cores, which enhances performance by reducing the overhead associated with moving threads between cores. This also helps maintain cache locality, an important factor for the efficient execution of AI models.</p><p><strong>Example Code: Setting Thread Affinity</strong></p><pre>import torch<br><br># Set thread affinity (for PyTorch 1.8 and later)<br>torch.set_num_threads(4)<br>torch.set_num_interop_threads(4)</pre><h3>TorchScript and AI Inference</h3><p>TorchScript enables PyTorch models to run on various platforms without requiring a Python interpreter. This is essential for deploying AI models in production environments, such as mobile devices, web servers, or embedded systems.</p><h4>Serialization</h4><p>TorchScript allows you to serialize a PyTorch model into a format that can be saved to disk and later loaded for inference. This serialized model can be executed in a C++ runtime, which is often more efficient for production deployment of AI models.</p><p><strong>Example Code: Converting and Saving a Model to TorchScript</strong></p><pre>import torch<br>import torchvision<br><br># Define and train the model<br>model = torchvision.models.resnet18(pretrained=True)<br>model.eval()<br><br># Convert the model to TorchScript<br>scripted_model = torch.jit.script(model)<br>scripted_model.save(&quot;resnet18_scripted.pt&quot;)</pre><h4>Optimization</h4><p>TorchScript provides various optimizations that enhance the performance of AI models during inference. These optimizations include operation fusion, where multiple operations are combined into a single operation, reducing the overhead and improving efficiency.</p><h4>Deployment</h4><p>TorchScript simplifies the deployment of AI models across different environments. For instance, you can deploy a model on mobile devices using PyTorch Mobile or run it in a web browser using WebAssembly. This flexibility is vital for AI applications that need to operate in diverse environments.</p><p><strong>Example Code: Using the Model in a C++ Application</strong></p><pre>#include &lt;torch/script.h&gt; // TorchScript library<br><br>int main() {<br>    // Load the TorchScript model<br>    torch::jit::script::Module model;<br>    model = torch::jit::load(&quot;resnet18_scripted.pt&quot;);<br><br>    // Prepare the input tensor<br>    std::vector&lt;torch::jit::IValue&gt; inputs;<br>    inputs.push_back(torch::rand({1, 3, 224, 224}));<br><br>    // Run inference<br>    at::Tensor output = model.forward(inputs).toTensor();<br>    std::cout &lt;&lt; output &lt;&lt; std::endl;<br><br>    return 0;<br>}</pre><h3>Practical Considerations in AI</h3><p>When working with CPU threading and TorchScript inference in PyTorch, several practical considerations need to be addressed to ensure efficient execution of AI models.</p><h4>Thread Management</h4><p>Managing the number of threads is crucial for optimal performance. Too many threads can lead to context-switching overhead, while too few threads may not fully utilize the CPU’s capabilities. PyTorch allows you to configure the number of threads used for different operations.</p><p><strong>Example Code: Setting the Number of Threads</strong></p><pre>import torch<br><br># Set the number of threads<br>torch.set_num_threads(8)<br>torch.set_num_interop_threads(8)</pre><h4>Model Optimization</h4><p>Before deploying AI models, optimizing them can significantly enhance performance. Techniques such as quantization (reducing the precision of the model weights) and pruning (removing unnecessary parts of the model) help reduce the model’s size and speed up inference.</p><p><strong>Example Code: Model Quantization</strong></p><pre>import torch.quantization<br><br># Prepare the model for quantization<br>model = torchvision.models.resnet18(pretrained=True)<br>model.eval()<br>model.qconfig = torch.quantization.get_default_qconfig(&#39;fbgemm&#39;)<br><br># Quantize the model<br>torch.quantization.prepare(model, inplace=True)<br>torch.quantization.convert(model, inplace=True)</pre><h4>Profiling and Benchmarking</h4><p>Profiling your AI model to identify performance bottlenecks is essential. PyTorch provides tools to profile and benchmark models, helping you understand and address performance issues.</p><p><strong>Example Code: Model Profiling</strong></p><pre>import torch<br>import torchvision<br>from torch.profiler import profile, record_function, ProfilerActivity<br><br>model = torchvision.models.resnet18(pretrained=True)<br>model.eval()<br><br>inputs = torch.randn(1, 3, 224, 224)<br><br># Profiling<br>with profile(activities=[ProfilerActivity.CPU], record_shapes=True) as prof:<br>    with record_function(&quot;model_inference&quot;):<br>        model(inputs)<br><br>print(prof.key_averages().table(sort_by=&quot;cpu_time_total&quot;, row_limit=10))</pre><h3>Example Workflow</h3><p>Let’s walk through a step-by-step workflow of training an AI model, converting it to TorchScript, and using it for inference.</p><h4>1. Training and Saving a Model</h4><p>First, a model is trained and converted to the TorchScript format.</p><pre>import torch<br>import torchvision<br><br># Define and train the model<br>model = torchvision.models.resnet18(pretrained=True)<br>model.eval()<br><br># Convert the model to TorchScript<br>scripted_model = torch.jit.script(model)<br>scripted_model.save(&quot;resnet18_scripted.pt&quot;)</pre><h4>2. Loading and Using the Model for Inference</h4><p>The model is loaded in a C++ application and used for inference.</p><pre>#include &lt;torch/script.h&gt; // TorchScript library<br><br>int main() {<br>    // Load the TorchScript model<br>    torch::jit::script::Module model;<br>    model = torch::jit::load(&quot;resnet18_scripted.pt&quot;);<br><br>    // Prepare the input tensor<br>    std::vector&lt;torch::jit::IValue&gt; inputs;<br>    inputs.push_back(torch::rand({1, 3, 224, 224}));<br><br>    // Run inference<br>    at::Tensor output = model.forward(inputs).toTensor();<br>    std::cout &lt;&lt; output &lt;&lt; std::endl;<br><br>    return 0;<br>}</pre><h3>Inter-op and Intra-op Parallelism Settings</h3><p>PyTorch enhances performance by utilizing both inter-op (between operations) and intra-op (within an operation) parallelism. Inter-op parallelism allows different operations to run simultaneously, while intra-op parallelism divides a single operation into multiple parts that can run concurrently.</p><p><strong>Example Code: Parallelism Settings</strong></p><pre>import torch<br><br># Inter-op parallelism setting<br>torch.set_num_interop_threads(4)<br># Intra-op parallelism setting<br>torch.set_num_threads(4)</pre><h3>Conclusion</h3><p>Understanding CPU threading and TorchScript inference in PyTorch is crucial for deploying efficient and scalable AI models. By leveraging threading, CPU resources are utilized more effectively, and TorchScript allows models to run on various platforms independently from Python. This combination of techniques enables the development of high-performance AI applications capable of handling large-scale data processing and real-time inference tasks.</p><p>In the context of AI, these tools and techniques are essential for pushing the boundaries of what AI systems can achieve. This makes it possible to deploy sophisticated models across diverse environments, from powerful data centers to edge devices like smartphones and IoT devices. By optimizing the performance and scalability of AI models, PyTorch and TorchScript play a pivotal role in advancing AI technology.</p><h3>References</h3><ol><li>PyTorch Documentation. “CPU Threading and TorchScript Inference.” <a href="https://pytorch.org/docs/stable/notes/cpu_threading_torchscript_inference.html">https://pytorch.org/docs/stable/notes/cpu_threading_torchscript_inference.html</a></li><li>PyTorch Documentation. “TorchScript Overview.” <a href="https://pytorch.org/docs/stable/jit.html">https://pytorch.org/docs/stable/jit.html</a></li><li>PyTorch Documentation. “Quantization.” <a href="https://pytorch.org/docs/stable/quantization.html">https://pytorch.org/docs/stable/quantization.html</a></li><li>Intel. “Math Kernel Library (MKL).” <a href="https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html">https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html</a></li><li>OpenMP. “The OpenMP API Specification for Parallel Programming.” <a href="https://www.openmp.org/specifications/">https://www.openmp.org/specifications/</a></li><li>PyTorch Documentation. “Profiler.” <a href="https://pytorch.org/docs/stable/profiler.html">https://pytorch.org/docs/stable/profiler.html</a></li></ol><h4>A Message from AI Mind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*5Wm7sOfTpe5DEbhg.gif" /></figure><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://pub.aimind.so/">AI Mind Publication</a></li><li>🧠 Improve your <a href="https://www.aimind.so/prompt-generator?utm_source=pub&amp;utm_medium=message">AI prompts effortlessly and FREE</a></li><li><strong>🧰 Discover </strong><a href="https://www.aimind.so/?utm_source=pub&amp;utm_medium=message"><strong>Intuitive AI Tools</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee493ba117ab" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/understanding-cpu-threading-and-torchscript-inference-in-pytorch-ee493ba117ab">Understanding CPU Threading and TorchScript Inference in PyTorch</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Calculating and Managing the Economic Burden of Running LLMs]]></title>
            <link>https://pub.aimind.so/calculating-and-managing-the-economic-burden-of-running-llms-c063b1b466ad?source=rss-6579d4b5dc6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c063b1b466ad</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Ridadogrul]]></dc:creator>
            <pubDate>Mon, 20 May 2024 12:29:51 GMT</pubDate>
            <atom:updated>2024-05-20T13:24:03.088Z</atom:updated>
            <content:encoded><![CDATA[<p>The cost of using large language models (LLMs) can be divided into two main categories: proprietary LLMs and open-source LLMs. In this article, we will explore the methods for calculating and managing costs for both categories in detail.</p><h3>What are LLMs?</h3><p>Large language models (LLMs) are deep learning models trained on massive datasets. These models can perform a wide range of natural language processing (NLP) tasks, including text generation, translation, question answering, and more. LLMs can have hundreds of billions of parameters, requiring substantial computational resources. Prominent examples of these models include OpenAI’s GPT-3.5 and GPT-4, and Google’s BERT and T5 models.</p><p>The use of LLMs, especially in large-scale projects and commercial applications, can incur significant costs. These costs can vary based on the type of model and its intended use. Accurately calculating and managing the costs of LLMs is crucial for both technical and economic efficiency.</p><h3>Proprietary LLMs</h3><p>Proprietary LLMs, such as GPT-3.5 or GPT-4, typically base their cost calculation on two main factors: the number of tokens and the number of characters processed. This involves determining the cost based on the amount of input (prompt) and output (completion) tokens or characters processed.</p><h3>Cost Calculation Using OpenAI API Requests</h3><p>The cost calculation process using the OpenAI API can be outlined as follows:</p><ol><li><strong>Determining Input and Output Token/Character Counts</strong>: The number of input and output tokens can be directly obtained from requests made to the OpenAI API. This method helps you clearly understand the input token count for a specific model and allows you to adjust the average or maximum limits for output tokens according to the task requirements.</li><li><strong>Using the </strong><strong>tiktoken Python Library</strong>: To accurately determine the token count for a specific model, you can use the tiktoken Python library. This library facilitates the segmentation of texts into tokens and calculates the token counts. For example:</li></ol><pre>import tiktoken<br><br>enc = tiktoken.get_encoding(&quot;gpt-3.5-turbo&quot;)<br>text = &quot;This is a sample text.&quot;<br>token_count = len(enc.encode(text))<br>print(f&quot;Token count: {token_count}&quot;)</pre><p><strong>3. OpenAI Pricing Calculator</strong>: You can use the OpenAI Pricing Calculator to estimate the cost of a specific number of tokens. This tool helps you predict the total cost based on the number of input and output tokens.</p><h3>Using Azure OpenAI Service</h3><p>If you are utilizing OpenAI services via Azure, you can observe the costs directly from the Azure OpenAI Service pricing page. Pricing can vary by region, so you should calculate costs based on the region you are using.</p><h3>Open-Source LLMs</h3><p>The cost calculation for open-source LLMs generally relies on hardware usage and performance benchmarks.</p><h3>Cost Calculation via Performance Benchmarking</h3><p>The cost calculation for open-source LLMs can be done as follows:</p><ol><li><strong>Benchmark Tests</strong>: By running parallel requests on GPU-supported machines, you can create a performance benchmark. This includes the number of tokens processed and the time taken during the operation, allowing you to determine the number of tokens processed per minute and the total time required to process all tokens.</li></ol><pre>import time<br>from transformers import AutoModelForCausalLM, AutoTokenizer<br><br>model_name = &quot;gpt-2&quot;<br>model = AutoModelForCausalLM.from_pretrained(model_name)<br>tokenizer = AutoTokenizer.from_pretrained(model_name)<br><br>text = &quot;This is a benchmark test.&quot;<br>inputs = tokenizer(text, return_tensors=&quot;pt&quot;)<br>start_time = time.time()<br>outputs = model(**inputs)<br>end_time = time.time()<br><br>elapsed_time = end_time - start_time<br>token_count = len(inputs[&quot;input_ids&quot;][0])<br>tokens_per_minute = (token_count / elapsed_time) * 60<br><br>print(f&quot;Tokens processed per minute: {tokens_per_minute}&quot;)</pre><p><strong>2. Calculating Cloud Costs</strong>: The cost of operation can be calculated based on the overall cost of running the model on a cloud service. For example, if you are running a GPU-supported machine on AWS or Google Cloud, you can determine the total cost by considering the hourly rates and the number of tokens processed.</p><pre>Example calculation:<br>- AWS p3.2xlarge (1 Tesla V100 GPU): $3.06/hour<br>- Tokens processed per minute: 5000 tokens<br>- Total tokens processed per day: 5000 tokens * 60 minutes * 24 hours = 7,200,000 tokens<br>- Daily cost: $3.06/hour * 24 hours = $73.44</pre><h3>Commercial Use and Revenue Analysis</h3><p>For open-source models without commercial use restrictions, the cost of running the model on the cloud can be directly calculated. For models with commercial use restrictions, the cost of running the LLM can be approximately estimated by considering the revenue generated from the outputs produced.</p><p>In summary, the process of calculating and managing the costs of using LLMs can vary based on the type of model and its intended use. By employing accurate cost calculation methods for both proprietary and open-source LLMs, you can effectively manage the economic burden of these technologies.</p><h3>References</h3><ol><li>OpenAI Pricing Calculator. Available at: <a href="https://openai.com/pricing">OpenAI Pricing Calculator</a></li><li>OpenAI API Documentation. Available at: <a href="https://beta.openai.com/docs/">OpenAI API Docs</a></li><li>Azure OpenAI Service Pricing. Available at: <a href="https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/">Azure OpenAI Service Pricing</a></li></ol><h4>A Message from AI Mind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*5Wm7sOfTpe5DEbhg.gif" /></figure><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://pub.aimind.so/">AI Mind Publication</a></li><li>🧠 Improve your <a href="https://www.aimind.so/prompt-generator?utm_source=pub&amp;utm_medium=message">AI prompts effortlessly and FREE</a></li><li><strong>🧰 Discover </strong><a href="https://www.aimind.so/?utm_source=pub&amp;utm_medium=message"><strong>Intuitive AI Tools</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c063b1b466ad" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/calculating-and-managing-the-economic-burden-of-running-llms-c063b1b466ad">Calculating and Managing the Economic Burden of Running LLMs</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Feature Extraction in Machine Learning Projects]]></title>
            <link>https://pub.aimind.so/feature-extraction-in-machine-learning-projects-37cec9edc292?source=rss-6579d4b5dc6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/37cec9edc292</guid>
            <category><![CDATA[feature-extraction]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Ridadogrul]]></dc:creator>
            <pubDate>Mon, 20 May 2024 11:54:33 GMT</pubDate>
            <atom:updated>2024-05-20T13:27:12.137Z</atom:updated>
            <content:encoded><![CDATA[<p>Machine learning continues to attract significant interest in both the private sector and academia. The ability of computers and machines to derive meaning from data is fundamental to a successful machine learning model. One of the most critical steps in this process is the extraction of meaningful information from the dataset, known as features. In this article, we will explore the importance of feature extraction in machine learning projects, the methods used, and detailed examples of their application.</p><h3>What is a Feature?</h3><p>A feature is an individual measurable property or characteristic of a dataset. Machine learning models analyze data and make predictions using these features. Well-defined and meaningful features can significantly enhance model performance. Features transform raw data into a format that the model can understand and use.</p><h3>Importance of Feature Extraction</h3><p>Feature extraction is a crucial step in the machine learning process. Selecting the right features improves the accuracy and overall performance of the model. Incorrect or unnecessary features can increase the model’s complexity and degrade its performance. Feature extraction accelerates the learning process of the model and allows higher accuracy with less data.</p><h3>Feature Extraction Methods</h3><p>There are several methods for feature extraction. These include:</p><h4>1. Statistical Features</h4><p>Statistical methods extract the fundamental characteristics of the data. These methods aim to obtain meaningful information using summary statistics of the data. For example:</p><ul><li><strong>Mean:</strong> Represents the central value of the dataset.</li><li><strong>Standard Deviation:</strong> Measures the spread of the data.</li><li><strong>Median:</strong> Represents the middle value of the dataset.</li><li><strong>Maximum and Minimum Values:</strong> The highest and lowest values in the dataset.</li></ul><p>These statistical features help understand the general behavior of the data and detect anomalies.</p><h4>2. Transformations and Filtering</h4><p>Data transformations can make raw data more meaningful. Some common transformations include:</p><ul><li><strong>Normalization:</strong> Converts data to a specific range. This makes data on different scales comparable.</li><li><strong>Log Transformation:</strong> Converts positive data to a logarithmic scale. This is used to balance extremely large or small values in the data.</li><li><strong>Feature Scaling:</strong> Ensures that data is within a specific range. For example, min-max scaling converts data to a range between 0 and 1.</li><li><strong>Standardization:</strong> Converts data so that it has a mean of 0 and a standard deviation of 1. This can improve performance in linear models.</li></ul><h4>3. Domain Expert Knowledge</h4><p>Domain experts play a critical role in determining the importance of features in a dataset. Experts identify which features are important and how they should be extracted. This knowledge is invaluable in the feature engineering process. Domain experts understand the context of the data and the business problem, enabling the model to make more accurate and meaningful predictions.</p><h3>Example Applications</h3><p>Let’s explore how feature extraction is applied in different fields:</p><h4>1. Text Mining</h4><p>In text mining, meaningful features are extracted from raw text. For example:</p><ul><li><strong>Word Frequencies:</strong> Measures how often specific words occur.</li><li><strong>N-grams:</strong> Analyzes the frequency of word pairs or triplets.</li><li><strong>TF-IDF (Term Frequency-Inverse Document Frequency):</strong> Measures the importance of words within a document. TF-IDF assigns higher weights to words that occur frequently but in fewer documents.</li></ul><p>Text mining applications include sentiment analysis, topic modeling, and spam detection.</p><h4>2. Image Processing</h4><p>In image processing projects, feature extraction involves obtaining meaningful information from pixels. For example:</p><ul><li><strong>Edge Detection:</strong> Identifies the edges of objects in an image.</li><li><strong>Color Histograms:</strong> Analyzes the distribution of colors in an image.</li><li><strong>Feature Points:</strong> Identifies significant points and patterns in an image.</li></ul><p>These techniques are used in applications such as object recognition, face recognition, and image classification.</p><h4>3. Time Series Analysis</h4><p>In time series data, features such as seasonal changes and trends are extracted. For example:</p><ul><li><strong>Moving Average:</strong> Calculates the average value of a time series over a specified period.</li><li><strong>Fourier Transform:</strong> Analyzes the frequency components of a time series.</li><li><strong>Seasonality and Trend:</strong> Identifies periodic and long-term trends in the data.</li></ul><p>Time series analysis is important in financial forecasting, sales predictions, and sensor data analysis.</p><h3>Dimensionality Reduction and Feature Extraction Methods</h3><p>Feature extraction aims to reduce the number of features in a dataset by creating new features from existing ones (and then discarding the original features). This enables the model to learn faster and more efficiently. Here are some feature extraction methods:</p><h4>1. PCA (Principal Component Analysis)</h4><p>PCA is a technique that aims to retain the most variance in the dataset while reducing its dimensionality. PCA represents data in fewer dimensions, allowing the model to work faster and more accurately. For example, in image data, PCA can represent the image using a few principal components instead of pixel values.</p><h4>2. Kernel PCA</h4><p>Kernel PCA is developed to help classify data with decision boundaries defined by non-linear functions. This method aims to transform the data into a higher-dimensional space where the decision boundary becomes linear. Kernel PCA simplifies and makes complex data more manageable. It is used in datasets requiring non-linear separation.</p><h4>3. LDA (Linear Discriminant Analysis)</h4><p>LDA is a multivariate statistical method that aims to assign units to their true classes based on a predetermined number of features. LDA maximizes the differences between classes and minimizes the differences within classes. This is an effective method, especially in classification problems. For example, in face recognition applications, LDA can classify different facial expressions.</p><h3>Conclusion</h3><p>Feature extraction is crucial for the success of machine learning projects. Selecting the right features significantly enhances the accuracy and overall performance of the model. Statistical methods, transformations, domain expert knowledge, and various example applications illustrate how feature extraction can be performed. Feature extraction makes the data meaningful and usable, enabling the model to work faster and more accurately. By giving due importance to feature extraction in your machine learning projects, you will see a noticeable improvement in the performance of your models.</p><h3>References</h3><ol><li><a href="https://www.researchgate.net/publication/333754730_Diverse_Perspectives_on_the_Relationship_between_Artificial_Intelligence_and_Pattern_Recognition">ResearchGate Article on Text Mining</a></li><li><a href="https://www.edureka.co/blog/pattern-recognition/#Introduction">Edureka Blog on Text Mining</a></li><li><a href="https://dzone.com/articles/machine-learning-and-pattern-recognition">DZone Article on Text Mining</a></li><li><a href="https://en.wikipedia.org/wiki/Pattern_recognition">Wikipedia Article on Image Processing</a></li><li><a href="https://builtin.com/data-science/step-step-explanation-principal-component-analysis">BuiltIn Article on PCA</a></li><li><a href="https://nirpyresearch.com/pca-kernel-pca-explained/">Nirpy Research Article on Kernel PCA</a></li></ol><h4>A Message from AI Mind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*5Wm7sOfTpe5DEbhg.gif" /></figure><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://pub.aimind.so/">AI Mind Publication</a></li><li>🧠 Improve your <a href="https://www.aimind.so/prompt-generator?utm_source=pub&amp;utm_medium=message">AI prompts effortlessly and FREE</a></li><li><strong>🧰 Discover </strong><a href="https://www.aimind.so/?utm_source=pub&amp;utm_medium=message"><strong>Intuitive AI Tools</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37cec9edc292" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/feature-extraction-in-machine-learning-projects-37cec9edc292">Feature Extraction in Machine Learning Projects</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enhancing Small Object Detection: Strategies and Implementations]]></title>
            <link>https://pub.aimind.so/enhancing-small-object-detection-strategies-and-implementations-c3a5d85f3805?source=rss-6579d4b5dc6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3a5d85f3805</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[object-detection]]></category>
            <dc:creator><![CDATA[Ridadogrul]]></dc:creator>
            <pubDate>Mon, 20 May 2024 10:48:47 GMT</pubDate>
            <atom:updated>2024-05-20T13:31:28.643Z</atom:updated>
            <content:encoded><![CDATA[<p>Detecting small objects in images is a challenging task in computer vision, primarily due to the limited amount of information available from small objects compared to larger ones. Small objects occupy fewer pixels, making it harder for detection algorithms to extract meaningful features. Here, we will explore various techniques and strategies to enhance the detection of small objects in images.</p><h3>Key Techniques for Small Object Detection</h3><ol><li><strong>Higher Resolution Input:</strong></li></ol><ul><li><strong>Approach:</strong> Use higher resolution images during both training and inference. Higher resolution ensures that small objects have more pixels, making it easier for the model to learn their features.</li><li><strong>Implementation:</strong> Increase the input image size before feeding it into the detection network.</li></ul><pre>high_res_image = cv2.resize(original_image, (1024, 1024))</pre><p><strong>2. Anchor Box Adjustments:</strong></p><ul><li><strong>Approach:</strong> Design anchor boxes (default bounding boxes) that are specifically tailored for small objects. This involves using smaller scales and aspect ratios.</li><li><strong>Implementation:</strong> Adjust the scales and aspect ratios of the anchor boxes in the detection network configuration.</li></ul><pre>scales = [32, 64, 128]  # Example scales for small objects<br>aspect_ratios = [0.5, 1, 2]  # Example aspect ratios</pre><p>3. <strong>Feature Pyramid Networks (FPN):</strong></p><ul><li><strong>Approach:</strong> Use FPNs to extract multi-scale feature maps from different levels of the backbone network. This allows the network to detect objects at various scales effectively.</li><li><strong>Implementation:</strong> Integrate an FPN module in the object detection network.</li></ul><pre>from keras.layers import Conv2D, UpSampling2D, Add<br><br>def fpn_block(input_tensor, filters):<br>    x = Conv2D(filters, (1, 1))(input_tensor)<br>    x = UpSampling2D()(x)<br>    return x<br><br>fpn_output = Add()([fpn_block(c4, 256), fpn_block(c3, 256), fpn_block(c2, 256)])</pre><p>4. <strong>Context Information:</strong></p><ul><li><strong>Approach:</strong> Use contextual information around small objects to improve detection. This can be achieved by incorporating surrounding regions into the feature extraction process.</li><li><strong>Implementation:</strong> Expand the receptive field of the network to include more contextual information.</li></ul><pre>from keras.layers import Conv2D, MaxPooling2D<br><br>def context_block(input_tensor, filters):<br>    x = Conv2D(filters, (3, 3), padding=&#39;same&#39;, activation=&#39;relu&#39;)(input_tensor)<br>    x = MaxPooling2D((2, 2))(x)<br>    return x<br><br>context_output = context_block(input_tensor, 256)</pre><p>5. <strong>Data Augmentation:</strong></p><ul><li><strong>Approach:</strong> Use data augmentation techniques that specifically target small objects. Techniques such as random cropping, scaling, and translation can help the model learn better representations of small objects.</li><li><strong>Implementation:</strong> Apply data augmentation during the preprocessing step.</li></ul><pre>from keras.preprocessing.image import ImageDataGenerator<br><br>datagen = ImageDataGenerator(<br>    width_shift_range=0.1,<br>    height_shift_range=0.1,<br>    zoom_range=0.2<br>)</pre><p>6. <strong>Attention Mechanisms:</strong></p><ul><li><strong>Approach:</strong> Incorporate attention mechanisms that focus the network’s resources on small objects. This can help the network to better distinguish small objects from the background.</li><li><strong>Implementation:</strong> Add an attention module to the detection network.</li></ul><pre>from keras.layers import Multiply, GlobalAveragePooling2D, Dense, Reshape<br><br>def attention_module(input_tensor):<br>    attention = GlobalAveragePooling2D()(input_tensor)<br>    attention = Dense(128, activation=&#39;relu&#39;)(attention)<br>    attention = Dense(input_tensor.shape[-1], activation=&#39;sigmoid&#39;)(attention)<br>    attention = Reshape((1, 1, input_tensor.shape[-1]))(attention)<br>    return Multiply()([input_tensor, attention])<br><br>attention_output = attention_module(feature_map)</pre><p><strong>7. Loss Function Adjustments:</strong></p><ul><li><strong>Approach:</strong> Modify the loss function to give more weight to small object detections. This helps in reducing the imbalance between small and large object detections.</li><li><strong>Implementation:</strong> Adjust the loss function to penalize the misclassification of small objects more heavily.</li></ul><pre>def weighted_loss(y_true, y_pred):<br>    small_object_weight = 5.0<br>    loss = keras.losses.binary_crossentropy(y_true, y_pred)<br>    loss = loss * small_object_weight<br>    return loss<br><br>model.compile(optimizer=&#39;adam&#39;, loss=weighted_loss)</pre><h3>Architecture for Small Object Detection</h3><h4>1. Input Layer</h4><ul><li><strong>High-Resolution Input:</strong> Use high-resolution images to ensure that small objects occupy more pixels. This improves the detail captured for small objects.</li></ul><h4>2. Backbone Network (Convolutional Neural Network — CNN)</h4><ul><li><strong>Function:</strong> Extracts features from the input image.</li><li><strong>Common Architectures:</strong> ResNet, VGG, or MobileNet.</li><li><strong>Layers:</strong> Multiple convolutional layers followed by activation functions (ReLU) and pooling layers (max pooling or average pooling).</li></ul><h4>3. Feature Pyramid Network (FPN)</h4><ul><li><strong>Function:</strong> Builds feature pyramids to handle objects at multiple scales, enhancing small object detection.</li><li><strong>Components:</strong></li><li><strong>Lateral Connections:</strong> Connect feature maps from different levels of the backbone.</li><li><strong>Top-down Pathway:</strong> Upsamples higher-level feature maps and combines them with lower-level feature maps using lateral connections.</li><li><strong>Output:</strong> Multi-scale feature maps (P2, P3, P4, P5, etc.).</li></ul><h4>4. Region Proposal Network (RPN)</h4><ul><li><strong>Function:</strong> Proposes candidate object regions (regions of interest) from the feature maps.</li><li><strong>Customized Anchors:</strong> Design smaller anchor boxes suitable for detecting small objects.</li><li><strong>Components:</strong></li><li><strong>Anchor Boxes:</strong> Predefined boxes of various scales and aspect ratios.</li><li><strong>Convolutional Layers:</strong> Process feature maps to generate region proposals.</li><li><strong>Classification Layer:</strong> Scores whether each anchor contains an object.</li><li><strong>Regression Layer:</strong> Adjusts the anchor boxes to fit the objects more precisely.</li></ul><h4>5. Region of Interest (RoI) Pooling</h4><ul><li><strong>Function:</strong> Extracts fixed-size feature maps from the proposed regions.</li><li><strong>Components:</strong></li><li><strong>RoI Align/RoI Pooling:</strong> Aligns and pools the features from the proposed regions to a fixed size for the detection head.</li></ul><h4>6. Attention Modules</h4><ul><li><strong>Function:</strong> Focuses on relevant parts of the feature maps to enhance small object detection.</li><li><strong>Components:</strong></li><li><strong>Spatial Attention:</strong> Focuses on the important spatial locations.</li><li><strong>Channel Attention:</strong> Enhances important feature channels.</li></ul><h4>7. Detection Head</h4><ul><li><strong>Function:</strong> Performs final object classification and bounding box regression.</li><li><strong>Components:</strong></li><li><strong>Fully Connected Layers:</strong> Process the pooled features.</li><li><strong>Classification Layer:</strong> Classifies the objects in the proposed regions.</li><li><strong>Bounding Box Regression Layer:</strong> Refines the bounding boxes for accurate localization.</li></ul><h3>Combining Techniques</h3><p>Combining multiple techniques can yield better results in detecting small objects. For instance, using a higher resolution input along with FPNs and attention mechanisms can significantly improve detection performance.</p><h3>Example Implementation with Faster R-CNN and FPN</h3><p>Here’s an example of how to modify Faster R-CNN with FPN to better detect small objects:</p><pre>from keras.layers import Conv2D, UpSampling2D, Add, Input<br>from keras.models import Model<br><br>def fpn_block(input_tensor, filters):<br>    x = Conv2D(filters, (1, 1))(input_tensor)<br>    x = UpSampling2D()(x)<br>    return x<br><br># Input layer<br>input_tensor = Input(shape=(None, None, 3))<br><br># Backbone network (e.g., ResNet)<br>c1, c2, c3, c4, c5 = backbone_network(input_tensor)<br><br># FPN<br>p5 = Conv2D(256, (1, 1))(c5)<br>p4 = Add()([fpn_block(c4, 256), p5])<br>p3 = Add()([fpn_block(c3, 256), p4])<br>p2 = Add()([fpn_block(c2, 256), p3])<br><br># Region Proposal Network (RPN)<br>rpn_class, rpn_bbox = rpn_network(p2, p3, p4, p5)<br><br># RoI Pooling and final detection head<br>roi_pooling = roi_pooling_layer(rpn_bbox, [p2, p3, p4, p5])<br>final_output = detection_head(roi_pooling)<br><br># Model<br>model = Model(inputs=input_tensor, outputs=final_output)<br>model.compile(optimizer=&#39;adam&#39;, loss=&#39;categorical_crossentropy&#39;, metrics=[&#39;accuracy&#39;])</pre><p>In this implementation:</p><ul><li>The backbone network extracts features from the input image.</li><li>The FPN generates multi-scale feature maps.</li><li>The RPN proposes regions of interest.</li><li>The RoI pooling layer and detection head perform the final object detection.</li></ul><p>By incorporating these techniques, we can improve the detection of small objects in various applications.</p><p>REFERENCES</p><p><strong>Higher Resolution Input:</strong></p><ul><li>Redmon, J., Divvala, S., Girshick, R., &amp; Farhadi, A. (2016). “You Only Look Once: Unified, Real-Time Object Detection.” In <em>Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition</em> (pp. 779–788).</li><li>Lin, T.-Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., … &amp; Zitnick, C. L. (2014). “Microsoft COCO: Common Objects in Context.” In <em>European Conference on Computer Vision</em> (pp. 740–755).</li></ul><p><strong>Anchor Box Adjustments:</strong></p><ul><li>Ren, S., He, K., Girshick, R., &amp; Sun, J. (2015). “Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks.” In <em>Advances in Neural Information Processing Systems</em> (pp. 91–99).</li><li>Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., Fu, C.-Y., &amp; Berg, A. C. (2016). “SSD: Single Shot MultiBox Detector.” In <em>European Conference on Computer Vision</em> (pp. 21–37).</li></ul><p><strong>Feature Pyramid Networks (FPN):</strong></p><ul><li>Lin, T.-Y., Dollár, P., Girshick, R., He, K., Hariharan, B., &amp; Belongie, S. (2017). “Feature Pyramid Networks for Object Detection.” In <em>Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition</em> (pp. 2117–2125).</li></ul><p><strong>Context Information:</strong></p><ul><li>Bell, S., Lawrence Zitnick, C., Bala, K., &amp; Girshick, R. (2016). “Inside-Outside Net: Detecting Objects in Context with Skip Pooling and Recurrent Neural Networks.” In <em>Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition</em> (pp. 2874–2883).</li><li>He, K., Zhang, X., Ren, S., &amp; Sun, J. (2014). “Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition.” In <em>European Conference on Computer Vision</em> (pp. 346–361).</li></ul><p><strong>Data Augmentation:</strong></p><ul><li>Shorten, C., &amp; Khoshgoftaar, T. M. (2019). “A survey on image data augmentation for deep learning.” In <em>Journal of Big Data</em>, 6(1), 60.</li><li>Howard, A. G. (2013). “Some Improvements on Deep Convolutional Neural Network Based Image Classification.” In <em>arXiv preprint arXiv:1312.5402</em>.</li></ul><p><strong>Attention Mechanisms:</strong></p><ul><li>Wang, X., Girshick, R., Gupta, A., &amp; He, K. (2018). “Non-local Neural Networks.” In <em>Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition</em> (pp. 7794–7803).</li><li>Hu, J., Shen, L., &amp; Sun, G. (2018). “Squeeze-and-Excitation Networks.” In <em>Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition</em> (pp. 7132–7141).</li></ul><p><strong>Loss Function Adjustments:</strong></p><ul><li>Lin, T.-Y., Goyal, P., Girshick, R., He, K., &amp; Dollar, P. (2017). “Focal Loss for Dense Object Detection.” In <em>Proceedings of the IEEE International Conference on Computer Vision</em> (pp. 2980–2988).</li><li>Li, H., Lin, Z., Shen, X., Brandt, J., &amp; Hua, G. (2015). “A Convolutional Neural Network Cascade for Face Detection.” In <em>Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition</em> (pp. 5325–5334).</li></ul><h4>A Message from AI Mind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*5Wm7sOfTpe5DEbhg.gif" /></figure><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://pub.aimind.so/">AI Mind Publication</a></li><li>🧠 Improve your <a href="https://www.aimind.so/prompt-generator?utm_source=pub&amp;utm_medium=message">AI prompts effortlessly and FREE</a></li><li><strong>🧰 Discover </strong><a href="https://www.aimind.so/?utm_source=pub&amp;utm_medium=message"><strong>Intuitive AI Tools</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3a5d85f3805" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/enhancing-small-object-detection-strategies-and-implementations-c3a5d85f3805">Enhancing Small Object Detection: Strategies and Implementations</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Computer Vision]]></title>
            <link>https://pub.aimind.so/computer-vision-aed8c4997822?source=rss-6579d4b5dc6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/aed8c4997822</guid>
            <category><![CDATA[cnn]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[r-cnn]]></category>
            <dc:creator><![CDATA[Ridadogrul]]></dc:creator>
            <pubDate>Mon, 20 May 2024 09:04:28 GMT</pubDate>
            <atom:updated>2024-05-20T13:28:32.363Z</atom:updated>
            <content:encoded><![CDATA[<p>Computer vision is a field of artificial intelligence (AI) that enables computers to interpret and make decisions based on visual data from the world. This technology has advanced rapidly, especially with the advent of deep learning, and has found extensive applications in various domains. In this article, we will delve into the technical foundations of computer vision, advanced algorithms used, and real-world applications.</p><h4>Fundamentals of Image Processing</h4><p>Computer vision systems process and interpret raw image data using various image processing techniques. The image processing steps typically include:</p><ol><li><strong>Preprocessing:</strong></li></ol><ul><li><strong>Noise Reduction:</strong> Techniques like Gaussian Blur and Median Filter are used to reduce noise in the image.</li><li><strong>Contrast Enhancement:</strong> Histogram equalization or CLAHE (Contrast Limited Adaptive Histogram Equalization) can be used to enhance image contrast.</li></ul><pre>import cv2<br>img = cv2.imread(&#39;image.jpg&#39;, 0)<br>img_blur = cv2.GaussianBlur(img, (5, 5), 0)<br>img_eq = cv2.equalizeHist(img_blur)</pre><p><strong>2. Feature Extraction:</strong></p><ul><li><strong>Edge Detection:</strong> Algorithms like Canny Edge Detection are used to detect edges.</li><li><strong>Corner and Keypoint Detection:</strong> Methods like Harris corner detector, SIFT, and SURF are employed to detect keypoints and extract features.</li></ul><pre>edges = cv2.Canny(img_eq, 100, 200)<br>sift = cv2.SIFT_create()<br>keypoints, descriptors = sift.detectAndCompute(img_eq, None)</pre><h4>Deep Learning-Based Algorithms</h4><p>One of the most powerful aspects of computer vision is the use of deep learning-based algorithms. These algorithms achieve high accuracy by training on large datasets.</p><ol><li><strong>Convolutional Neural Networks (CNN):</strong></li></ol><ul><li>CNNs are widely used for image classification and object recognition. The basic building blocks include convolutional layers, pooling layers, and fully connected layers.</li></ul><pre>from tensorflow.keras.models import Sequential<br>from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense<br><br>model = Sequential([<br>    Conv2D(32, (3, 3), activation=&#39;relu&#39;, input_shape=(64, 64, 3)),<br>    MaxPooling2D((2, 2)),<br>    Conv2D(64, (3, 3), activation=&#39;relu&#39;),<br>    MaxPooling2D((2, 2)),<br>    Flatten(),<br>    Dense(64, activation=&#39;relu&#39;),<br>    Dense(10, activation=&#39;softmax&#39;)<br>])<br>model.compile(optimizer=&#39;adam&#39;, loss=&#39;categorical_crossentropy&#39;, metrics=[&#39;accuracy&#39;])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/0*blfacs3f6o6iGY6p.png" /></figure><p><strong>2. Region-based CNN (R-CNN):</strong></p><ul><li>Variants like R-CNN, Fast R-CNN, Faster R-CNN, and Mask R-CNN are used for object detection and segmentation.</li><li><strong>R-CNN:</strong> Extracts features for each proposed region using CNN.</li><li><strong>Fast R-CNN:</strong> Performs classification and localization in a single step.</li><li><strong>Faster R-CNN:</strong> Uses a Region Proposal Network (RPN) for faster object detection.</li></ul><p><strong>3. Generative Adversarial Networks (GAN):</strong></p><ul><li>GANs are used for image generation and data augmentation. They consist of two networks: the generator and the discriminator.</li></ul><pre>from tensorflow.keras.models import Model<br>from tensorflow.keras.layers import Input, Dense, LeakyReLU<br><br># Generator<br>gen_input = Input(shape=(100,))<br>x = Dense(128)(gen_input)<br>x = LeakyReLU(alpha=0.2)(x)<br>x = Dense(256)(x)<br>x = LeakyReLU(alpha=0.2)(x)<br>gen_output = Dense(784, activation=&#39;tanh&#39;)(x)<br>generator = Model(gen_input, gen_output)<br><br># Discriminator<br>disc_input = Input(shape=(784,))<br>x = Dense(256)(disc_input)<br>x = LeakyReLU(alpha=0.2)(x)<br>x = Dense(128)(x)<br>x = LeakyReLU(alpha=0.2)(x)<br>disc_output = Dense(1, activation=&#39;sigmoid&#39;)(x)<br>discriminator = Model(disc_input, disc_output)</pre><h4>Real-World Applications</h4><p>Computer vision finds applications across various industries:</p><ol><li><strong>Autonomous Vehicles:</strong></li></ol><ul><li>Autonomous vehicles use computer vision algorithms to recognize road signs, other vehicles, and pedestrians.</li><li><strong>Features:</strong> Semantic segmentation for road detection, Faster R-CNN for object detection.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OwsE7NVaTSk7t3Is" /></figure><p><strong>2. Healthcare:</strong></p><ul><li>Medical image analysis uses computer vision techniques for disease diagnosis and treatment planning.</li><li><strong>Features:</strong> CNN-based segmentation algorithms for MRI and CT scans.</li></ul><p><strong>3. Security:</strong></p><ul><li>Security systems use computer vision algorithms for facial recognition and movement tracking.</li><li><strong>Features:</strong> Facial recognition using Haar cascades or dlib.</li></ul><h4>Conclusion</h4><p>Computer vision is one of the most exciting and rapidly advancing areas of modern artificial intelligence technology. In this article, we explored fundamental image processing techniques, deep learning-based algorithms, and real-world applications. Computer vision technologies will continue to evolve, creating revolutionary impacts across various domains.</p><h4>A Message from AI Mind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*5Wm7sOfTpe5DEbhg.gif" /></figure><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://pub.aimind.so/">AI Mind Publication</a></li><li>🧠 Improve your <a href="https://www.aimind.so/prompt-generator?utm_source=pub&amp;utm_medium=message">AI prompts effortlessly and FREE</a></li><li><strong>🧰 Discover </strong><a href="https://www.aimind.so/?utm_source=pub&amp;utm_medium=message"><strong>Intuitive AI Tools</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aed8c4997822" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/computer-vision-aed8c4997822">Computer Vision</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Analyzing and Optimizing Your Deep Learning Models Using TensorBoard with PyTorch]]></title>
            <link>https://pub.aimind.so/analyzing-and-optimizing-your-deep-learning-models-using-tensorboard-with-pytorch-cbfe873b7332?source=rss-6579d4b5dc6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbfe873b7332</guid>
            <category><![CDATA[tensorboard]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Ridadogrul]]></dc:creator>
            <pubDate>Mon, 06 May 2024 12:44:55 GMT</pubDate>
            <atom:updated>2024-05-06T17:16:32.037Z</atom:updated>
            <content:encoded><![CDATA[<p>TensorBoard is a powerful tool used to visualize the performance and behavior of deep learning models trained with PyTorch. In this blog post, we will delve into various visualization options offered by TensorBoard and explain how each can assist you in analyzing and optimizing your models.</p><p>PyTorch should be installed to log models and metrics into TensorBoard log directory.</p><pre>$ pip install torch torchvision</pre><ol><li>Creating a SummaryWriter:</li></ol><p>Before diving into TensorBoard, you need to create a SummaryWriter object to generate log files and write them to TensorBoard. You can do this using the following code:</p><pre>from torch.utils.tensorboard import SummaryWriter<br>writer = SummaryWriter(log_dir=&#39;runs/my_experiment&#39;)</pre><p>2. Visualizing Scalar Data:</p><p>In machine learning, it’s important to understand key metrics such as loss and how they change during training. Scalar helps to save the loss value of each training step, or the accuracy after each epoch.You can add scalar data using the add_scalar() method:</p><pre>#Training Loop<br>num_epochs = 50<br><br>for epoch in range(num_epochs):<br>    model.train()<br>    running_loss = 0.0<br>    total_correct = 0<br>    total_samples = 0<br>    <br>    for batch_idx, (images, labels) in enumerate(train_loader):<br>        images, labels = images.to(device), labels.to(device)<br>        <br>        optimizer.zero_grad()<br>        outputs = model(images)<br>        loss = criterion(outputs, labels)<br>        loss.backward()<br>        optimizer.step()<br>        <br>        running_loss += loss.item() * images.size(0)<br><br>        _, predicted = torch.max(outputs, 1)<br>        total_correct += predicted.eq(labels).sum().item()<br>        total_samples += labels.size(0)<br><br>    epoch_loss = running_loss / len(train_loader.dataset)<br>    epoch_accuracy = total_correct / total_samples<br><br>    # Log training loss and accuracy<br>    writer.add_scalar(&#39;Loss/train&#39;, epoch_loss, epoch)<br>    writer.add_scalar(&#39;Accuracy/train&#39;, epoch_accuracy, epoch)<br><br>    print(f&#39;Epoch [{epoch + 1}/{num_epochs}], Loss: {epoch_loss:.4f}, Accuracy: {epoch_accuracy:.4f}&#39;)</pre><p>3. Visualizing Image Data:</p><p>TensorBoard can also be used to visualize image data generated by trained models. You can add image data using the add_image() method:</p><pre>images = model(inputs)<br>writer.add_image(&#39;input_images&#39;, inputs, epoch)<br>writer.add_image(&#39;output_images&#39;, images, epoch)</pre><p>4. Visualizing Graphs:</p><p>TensorBoard allows visualization of your model’s graph. You can do this using the add_graph() method:</p><pre>writer.add_graph(model)</pre><p>5. Visualizing Histograms:</p><p>TensorBoard can be used to visualize histograms of your model’s weights and gradients. You can add histograms using the add_histogram() method:</p><pre>for name, param in model.named_parameters():<br>    writer.add_histogram(name, param, epoch)</pre><p>If you do not need the summary writer anymore, call close() method.</p><pre>writer.close()</pre><p>6. Lose Nothing:</p><p>The visualization options offered by TensorBoard allow you to deeply analyze the performance and behavior of your models. This can help you optimize your models and achieve better results.</p><p>7. Run Tensorboard:</p><pre>tensorboard --logdir=runs/my_experiment</pre><h4>A Message from AI Mind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*5Wm7sOfTpe5DEbhg.gif" /></figure><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://pub.aimind.so/">AI Mind Publication</a></li><li>🧠 Improve your <a href="https://www.aimind.so/prompt-generator?utm_source=pub&amp;utm_medium=message">AI prompts effortlessly and FREE</a></li><li><strong>🧰 Discover </strong><a href="https://www.aimind.so/?utm_source=pub&amp;utm_medium=message"><strong>Intuitive AI Tools</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbfe873b7332" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/analyzing-and-optimizing-your-deep-learning-models-using-tensorboard-with-pytorch-cbfe873b7332">Analyzing and Optimizing Your Deep Learning Models Using TensorBoard with PyTorch</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Rising Role of Transducers in Image Processing and SAM: Segment Anything Model]]></title>
            <link>https://pub.aimind.so/the-rising-role-of-transducers-in-image-processing-and-sam-segment-anything-model-d186394dbf9a?source=rss-6579d4b5dc6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/d186394dbf9a</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[segment-anything-model]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Ridadogrul]]></dc:creator>
            <pubDate>Fri, 22 Mar 2024 09:51:36 GMT</pubDate>
            <atom:updated>2024-03-22T15:17:22.988Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The Rising Role of Transducers in Image Processing and SAM: Segment Anything Model</strong></p><p>Transducers, particularly in Natural Language Processing (NLP), have seen growing use in various Artificial Intelligence domains. One such area is computer vision, where Transformer models have been successfully utilized for various tasks. For example, Stable Diffusion for image generation, Detection Transformer for object detection, and SAM for image segmentation are noteworthy. These models’ primary advantage is their ability to manipulate images using text prompts, making them highly versatile.</p><p>Stable Diffusion</p><p>Stable Diffusion is a transformer model for image generation, employing a probability distribution network-based approach. It enhances images step-by-step, resulting in realistic images.</p><p>Detection Transformer</p><p>Detection Transformer is a transformer model for object detection tasks. It identifies and classifies objects in images using advanced feature extraction and attention mechanisms.</p><p><strong>SAM (Segment Anything Model)</strong></p><p>SAM is a transformer model for image segmentation tasks, identifying and classifying different objects in an image at the pixel level. It understands complex structures with field-based adaptation mechanisms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*S-GKakb0UwCVTzgD.png" /></figure><p><strong>The Technical Infrastructure of SAM</strong></p><p>Convolutional Neural Networks (CNNs) and Generative Adversarial Networks (GANs) play a crucial role in SAM’s capabilities. CNNs, as part of the image encoder, excel at learning spatial hierarchies of features in images, while GANs enhance the model’s ability to generate precise segmentation masks.</p><p><strong>CLIP (Contrastive Language-Image Pre-training)</strong></p><p>CLIP, developed by OpenAI, bridges the gap between text and images, associating and interpreting text commands with images. This integration improves SAM’s versatility, enabling it to process and respond to text-based inputs.</p><p><strong>SAM’s Components</strong></p><p>SAM’s components include an Image Encoder, Prompt Encoder, and Mask Decoder. The Image Encoder generates one-time image embeddings, while the Prompt Encoder encodes background points, masks, bounding boxes, or texts into an embedding vector in real-time. The Mask Decoder predicts segmentation masks based on embeddings from both encoders.</p><p><strong>How to Use SAM</strong></p><p>SAM simplifies image segmentation tasks, removing the need for manual segmentation and enabling annotators to focus on other crucial data tasks. Integrating SAM into the annotation workflow enhances productivity, accuracy, and consistency, reducing manual workload and allowing annotators to focus on more challenging tasks.</p><p><strong>Fine-Tuning SAM</strong></p><p>Fine-tuning SAM focuses on refining its mask decoder, given its intricate architecture and streamlined design. By fine-tuning the mask decoder, users can efficiently adapt SAM to specific tasks or datasets while conserving computational resources.References:</p><ol><li><a href="https://ai.meta.com/research/publications/segment-anything/">ai.meta.com/research/publications/segment-anything/</a></li><li>Kirillov, A., Wu, Y., He, K., &amp; Girshick, R. (2021). Segment Anything: An Efficient Model for Object Segmentation of Images and Videos. arXiv preprint arXiv:2110.05568.</li><li>Wu, Y., He, K., &amp; Facebook AI Research. (2021). Stable Diffusion: A Deep Neural Network for Image Generation. arXiv preprint arXiv:2102.07927.</li><li>Chen, T., Kornblith, S., Norouzi, M., &amp; Hinton, G. (2020). A Simple Framework for Contrastive Learning of Visual Representations. arXiv preprint arXiv:2002.05709.</li></ol><h4>A Message from AI Mind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*5Wm7sOfTpe5DEbhg.gif" /></figure><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://pub.aimind.so/">AI Mind Publication</a></li><li>🧠 Improve your <a href="https://www.aimind.so/prompt-generator?utm_source=pub&amp;utm_medium=message">AI prompts effortlessly and FREE</a></li><li><strong>🧰 Discover </strong><a href="https://www.aimind.so/?utm_source=pub&amp;utm_medium=message"><strong>Intuitive AI Tools</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d186394dbf9a" width="1" height="1" alt=""><hr><p><a href="https://pub.aimind.so/the-rising-role-of-transducers-in-image-processing-and-sam-segment-anything-model-d186394dbf9a">The Rising Role of Transducers in Image Processing and SAM: Segment Anything Model</a> was originally published in <a href="https://pub.aimind.so/">AI Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>