<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marie Claire Uwiringiyimana</title>
    <description>The latest articles on DEV Community by Marie Claire Uwiringiyimana (@marie_claireuwiringiyima).</description>
    <link>https://dev.to/marie_claireuwiringiyima</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4151862%2F6d4edba3-2fe3-4623-beed-e1a1064aaaf6.jpg</url>
      <title>DEV Community: Marie Claire Uwiringiyimana</title>
      <link>https://dev.to/marie_claireuwiringiyima</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marie_claireuwiringiyima"/>
    <language>en</language>
    <item>
      <title>Improving InkMind: Selecting an Open Large Language Model for AI-Powered Poetry Generation</title>
      <dc:creator>Marie Claire Uwiringiyimana</dc:creator>
      <pubDate>Mon, 26 Oct 2026 14:30:11 +0000</pubDate>
      <link>https://dev.to/marie_claireuwiringiyima/improving-inkmind-selecting-an-open-large-language-model-for-ai-powered-poetry-generation-h5a</link>
      <guid>https://dev.to/marie_claireuwiringiyima/improving-inkmind-selecting-an-open-large-language-model-for-ai-powered-poetry-generation-h5a</guid>
      <description>&lt;p&gt;&lt;strong&gt;Author:&lt;/strong&gt; Marie Claire Uwiringiyimana&lt;br&gt;
&lt;strong&gt;Project:&lt;/strong&gt; InkMind — AI-Powered Poetry Generation&lt;br&gt;
&lt;strong&gt;Field:&lt;/strong&gt; Natural Language Processing (NLP)&lt;/p&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;1. Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Natural Language Processing (NLP) is a branch of Artificial Intelligence that enables computers to process, understand, and generate human language. Recent developments in Large Language Models (LLMs) have significantly improved the ability of computers to produce meaningful text, answer questions, and support creative writing.&lt;/p&gt;

&lt;p&gt;As part of my NLP learning journey, I worked on &lt;strong&gt;InkMind&lt;/strong&gt;, a poetry generation project that transforms a simple word or idea into a complete poem. For example, a user can enter the word &lt;em&gt;"Love,"&lt;/em&gt; and the system generates a poem inspired by that theme.&lt;/p&gt;

&lt;p&gt;Our current implementation uses GPT-2, a pretrained language model developed by OpenAI. Although GPT-2 provides a foundation for generating poems, we want to explore whether another modern language model can produce more coherent, creative, and relevant poetry.&lt;/p&gt;

&lt;p&gt;To investigate this possibility, I reviewed the Botpress article &lt;em&gt;The 10 Best Large Language Models (LLMs) in 2026&lt;/em&gt; and examined the official documentation of several open-weight models. Based on this research, I selected Qwen3-4B-Instruct-2507 as the proposed alternative to GPT-2.&lt;/p&gt;

&lt;p&gt;This blog explains the models considered, why Qwen3 is suitable for InkMind, and how we will compare the two models using the same prompts.&lt;/p&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;2. Understanding Large Language Models&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Large Language Models are neural networks trained on large collections of text to learn patterns in human language. Many modern LLMs use the Transformer architecture and generate text by predicting the next token based on the preceding context.&lt;/p&gt;

&lt;p&gt;A token may represent a complete word, part of a word, or another text unit. By repeatedly predicting and generating tokens, a language model can produce sentences, paragraphs, stories, and poems.&lt;/p&gt;

&lt;p&gt;For example, InkMind receives the following input:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User prompt:&lt;/strong&gt; Love&lt;/p&gt;

&lt;p&gt;The model then generates a sequence of text inspired by that word, potentially producing several poetic lines and stanzas.&lt;/p&gt;

&lt;p&gt;Different models may generate different poems from the same prompt because they differ in their training, architecture, parameter count, instruction-following capabilities, and generation settings.&lt;/p&gt;

&lt;p&gt;According to Botpress, LLMs have different strengths, limitations, and deployment requirements. Therefore, selecting a model should depend on the intended application rather than simply choosing the largest or most popular model (Botpress, n.d.).&lt;/p&gt;

&lt;p&gt;For InkMind, the most important requirements are creative text generation, relevance to the user's prompt, coherent poetry, accessible model weights, and manageable computing requirements.&lt;/p&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;3. Existing Model: GPT-2&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;GPT-2 is the model currently used in InkMind. Developed by OpenAI, it is a decoder-only Transformer language model pretrained on English text to predict the next token in a sequence.&lt;/p&gt;

&lt;p&gt;The smallest GPT-2 model has approximately 124 million parameters. It can generate text from a prompt and can be further adapted to specific tasks through fine-tuning (OpenAI Community, n.d.).&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Advantages and Limitations of GPT-2&lt;/strong&gt;
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;✅ Advantages&lt;/th&gt;
&lt;th&gt;⚠️ Limitations&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;It is relatively lightweight and suitable for experimentation on modest computing resources.&lt;/td&gt;
&lt;td&gt;It may generate repetitive or incoherent text.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Its pretrained weights are available for download.&lt;/td&gt;
&lt;td&gt;It does not consistently follow detailed instructions because the standard model is not instruction-tuned.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;It can generate text without requiring a paid API for each generation.&lt;/td&gt;
&lt;td&gt;Its output may lose the original theme as a poem becomes longer.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;It can be integrated into Python applications using libraries such as Hugging Face Transformers.&lt;/td&gt;
&lt;td&gt;Its original training does not guarantee good poetic structure, rhythm, or emotional depth.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;It provides a useful baseline for evaluating alternative language models.&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These limitations do not mean GPT-2 cannot generate good poems. Instead, they provide reasons to investigate whether a newer model can improve InkMind's output.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Official model documentation:&lt;/strong&gt; &lt;a href="https://huggingface.co/openai-community/gpt2" rel="noopener noreferrer"&gt;GPT-2 on Hugging Face&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;4. Researching Alternative Large Language Models&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before selecting a replacement, I considered several models that offer different capabilities and deployment options.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;4.1 GPT-4o&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;GPT-4o is a general-purpose model designed to support tasks such as writing, reasoning, and instruction following. It could generate poems from short prompts and follow additional instructions concerning tone, style, and structure.&lt;/p&gt;

&lt;p&gt;For example, a user could enter &lt;em&gt;"Love"&lt;/em&gt; and request a romantic poem containing four stanzas and vivid imagery.&lt;/p&gt;

&lt;p&gt;However, using a hosted model through an API may involve usage charges and requires dependence on an external service. Its model weights are not available for ordinary local deployment.&lt;/p&gt;

&lt;p&gt;Although GPT-4o could be useful for a future version of InkMind, I did not select it because our experiment prioritizes an open-weight model that we can download and run ourselves.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;4.2 Gemma 3 (4B)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Gemma 3 is a family of language models developed by Google. Its four-billion-parameter version is a potential candidate for creative text generation and local experimentation.&lt;/p&gt;

&lt;p&gt;It offers an alternative to GPT-2, but its resource requirements are higher. In addition, the applicable Gemma model terms must be reviewed before choosing it for deployment.&lt;/p&gt;

&lt;p&gt;Gemma 3 remains a relevant candidate, but I selected Qwen3 because its specific model card documents open-ended text-generation improvements and its Apache 2.0 licence provides a clear basis for experimentation and adaptation.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;4.3 Mistral Small 3.1&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Mistral Small 3.1 is another model discussed in the Botpress comparison. It offers general-purpose language capabilities and open-weight deployment options.&lt;/p&gt;

&lt;p&gt;It could be evaluated for creative writing, but its computing requirements may be more demanding than those of smaller models.&lt;/p&gt;

&lt;p&gt;Since InkMind currently performs a focused task—generating poems from short prompts—we do not need to begin with a larger model unless our experiments demonstrate that its capabilities justify the additional resources.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;4.4 Qwen3-4B-Instruct-2507&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Qwen3-4B-Instruct-2507 is an instruction-tuned, four-billion-parameter language model in the Qwen3 family.&lt;/p&gt;

&lt;p&gt;Its official model card describes improvements in instruction following, text comprehension, multilingual capabilities, and open-ended tasks. It is distributed under the Apache 2.0 licence, which permits use and modification subject to the licence's conditions (Qwen, n.d.).&lt;/p&gt;

&lt;p&gt;These characteristics make Qwen3 a promising alternative for InkMind.&lt;/p&gt;

&lt;p&gt;Unlike the standard GPT-2 model, which primarily continues a sequence of text, Qwen3-4B-Instruct has been adapted to respond to instructions. This may help it interpret a creative request and produce a poem that follows the requested theme and structure.&lt;/p&gt;

&lt;p&gt;For example, the model can receive the following prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Write a complete poem about love. Use four stanzas, emotional language, vivid imagery, and a hopeful ending.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model can then attempt to generate a poem that follows those requirements.&lt;/p&gt;

&lt;p&gt;However, instruction tuning does not automatically guarantee superior poetry. We must evaluate the actual outputs produced by Qwen3 and GPT-2 using the same prompts and assessment criteria.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Official model card:&lt;/strong&gt; &lt;a href="https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507" rel="noopener noreferrer"&gt;Qwen3-4B-Instruct-2507 on Hugging Face&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;5. Comparing the Models for InkMind&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The following table summarizes the models considered during my research.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Main strength&lt;/th&gt;
&lt;th&gt;Main limitation&lt;/th&gt;
&lt;th&gt;Suitability for InkMind&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;GPT-2&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Lightweight text generation&lt;/td&gt;
&lt;td&gt;May struggle with coherence and detailed instructions&lt;/td&gt;
&lt;td&gt;Existing baseline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;GPT-4o&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;General-purpose generation and instruction following&lt;/td&gt;
&lt;td&gt;Hosted API dependency and potential usage costs&lt;/td&gt;
&lt;td&gt;Alternative requiring an external service&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Gemma 3 (4B)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modern, relatively compact model&lt;/td&gt;
&lt;td&gt;Higher resource requirements than GPT-2&lt;/td&gt;
&lt;td&gt;Potential local alternative&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Mistral Small 3.1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;General-purpose language generation&lt;/td&gt;
&lt;td&gt;More demanding deployment requirements&lt;/td&gt;
&lt;td&gt;Candidate for later evaluation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Qwen3-4B-Instruct-2507&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Instruction following and open-ended generation&lt;/td&gt;
&lt;td&gt;Requires more computing resources than GPT-2&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Selected alternative&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The comparison is based on the models' documented characteristics, not on a completed benchmark of InkMind. Therefore, the table identifies promising candidates rather than claiming that one model has already won the poetry-generation experiment.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;6. My Selected Model: Qwen3-4B-Instruct-2507&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;After considering the available alternatives, &lt;strong&gt;I selected Qwen3-4B-Instruct-2507 as the proposed replacement model for InkMind's GPT-2 implementation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My choice is based on the following reasons.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;6.1 Open-Weight Availability&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Qwen3-4B-Instruct-2507 provides downloadable model weights. This allows us to experiment with the model in our own environment instead of depending entirely on a commercial text-generation API.&lt;/p&gt;

&lt;p&gt;Its Apache 2.0 licence also permits broad use and adaptation, subject to the licence terms.&lt;/p&gt;

&lt;p&gt;This is important because we want to understand how the model works, integrate it into our application, and evaluate its output directly.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;6.2 Better Instruction Following&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;InkMind currently accepts a simple word as a prompt. In the future, we may want users to specify a poem's mood, length, style, or structure.&lt;/p&gt;

&lt;p&gt;Qwen3-4B-Instruct is designed to follow instructions, making it a promising candidate for supporting both simple prompts and more detailed creative requests.&lt;/p&gt;

&lt;p&gt;For example, users could generate a poem about love and then request a sad, romantic, inspirational, or humorous version.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;6.3 Potential for Improved Creative Writing&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The Qwen3 model card reports improvements in open-ended text generation and alignment with user preferences. These capabilities suggest that it is worth evaluating for poetry generation.&lt;/p&gt;

&lt;p&gt;However, the model has not been specifically proven superior for InkMind's poetry task. We will determine whether it produces better results through our own experiment.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;6.4 Flexibility for Future Development&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Because Qwen3 can be run using supported local inference tools and adapted where appropriate, it gives us flexibility as InkMind develops.&lt;/p&gt;

&lt;p&gt;We could later explore more advanced prompting, poetry-specific fine-tuning, or additional generation controls without necessarily changing the overall purpose of the application.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;6.5 A Suitable Research Comparison&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Comparing GPT-2 with Qwen3 will help us investigate how a lightweight pretrained language model differs from a newer instruction-tuned model.&lt;/p&gt;

&lt;p&gt;The experiment will also help us understand the relationship between model size, instruction following, output quality, and computing requirements.&lt;/p&gt;

&lt;p&gt;Although Qwen3 has substantially more parameters than GPT-2 small, a larger parameter count alone does not prove that it will generate better poems. The quality of the output and the cost of generating it must both be considered.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;7. How We Will Compare GPT-2 and Qwen3&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To determine whether Qwen3 improves InkMind, we will conduct a controlled comparison.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;7.1 Experimental Procedure&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Prepare the prompts.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will use the same five prompts for both models:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Love&lt;/li&gt;
&lt;li&gt;Hope&lt;/li&gt;
&lt;li&gt;Nature&lt;/li&gt;
&lt;li&gt;Friendship&lt;/li&gt;
&lt;li&gt;Dreams&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Generate poems using GPT-2.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will enter each prompt into the existing InkMind implementation and save the generated poems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Generate poems using Qwen3.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will provide the same prompts to Qwen3 and save its generated poems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Keep the comparison fair.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will use consistent output-length targets where possible, record the generation settings, and distinguish the effects of model choice from the effects of prompting.&lt;/p&gt;

&lt;p&gt;Because GPT-2 is a base model and Qwen3 is instruction-tuned, the prompt formats may differ. We will document any formatting differences while keeping the requested poem topic and evaluation requirements equivalent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Evaluate the outputs.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will compare the poems according to relevance, coherence, creativity, repetition, poetic structure, and generation time.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;7.2 Evaluation Criteria&lt;/strong&gt;
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Criterion&lt;/th&gt;
&lt;th&gt;What we will evaluate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Prompt relevance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Does the poem reflect the original word?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Coherence&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Do the lines communicate a consistent idea?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Creativity&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Does the poem use interesting language and imagery?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Repetition&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Does it repeat lines, phrases, or ideas unnecessarily?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Poetic structure&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Are the line breaks and stanzas appropriate?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Generation time&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;How long does each model take to produce the poem?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We will use human evaluation to assess creative qualities that cannot be fully captured by automated metrics.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;7.3 Results Table&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The following table will be completed after running the experiment.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Prompt&lt;/th&gt;
&lt;th&gt;GPT-2 output&lt;/th&gt;
&lt;th&gt;Qwen3 output&lt;/th&gt;
&lt;th&gt;Preferred output&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Love&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;To be recorded&lt;/td&gt;
&lt;td&gt;To be recorded&lt;/td&gt;
&lt;td&gt;To be evaluated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Hope&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;To be recorded&lt;/td&gt;
&lt;td&gt;To be recorded&lt;/td&gt;
&lt;td&gt;To be evaluated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Nature&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;To be recorded&lt;/td&gt;
&lt;td&gt;To be recorded&lt;/td&gt;
&lt;td&gt;To be evaluated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Friendship&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;To be recorded&lt;/td&gt;
&lt;td&gt;To be recorded&lt;/td&gt;
&lt;td&gt;To be evaluated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Dreams&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;To be recorded&lt;/td&gt;
&lt;td&gt;To be recorded&lt;/td&gt;
&lt;td&gt;To be evaluated&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This approach will allow us to make a decision based on observed results rather than assumptions.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;8. Challenges and Limitations&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Although Qwen3 is a promising choice, several limitations should be considered.&lt;/p&gt;

&lt;p&gt;First, its four billion parameters make it considerably larger than GPT-2 small. Running the model locally requires more memory and computing resources, and actual performance will depend on the hardware and model precision used.&lt;/p&gt;

&lt;p&gt;Second, instruction following does not guarantee that every generated poem will be coherent, original, or artistically meaningful. Human review remains necessary.&lt;/p&gt;

&lt;p&gt;Third, both models can produce repetitive language or outputs that do not fully match the user's intended meaning.&lt;/p&gt;

&lt;p&gt;Finally, the experiment will evaluate only a small set of prompts. A larger dataset and repeated evaluations would provide stronger evidence about overall performance.&lt;/p&gt;

&lt;p&gt;These limitations will be documented so that the final model selection reflects both output quality and practical deployment considerations.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;9. Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This research examined several Large Language Models that could potentially improve InkMind, an NLP project designed to generate complete poems from simple word prompts.&lt;/p&gt;

&lt;p&gt;After considering GPT-2, GPT-4o, Gemma 3, Mistral Small 3.1, and Qwen3-4B-Instruct-2507, I selected &lt;strong&gt;Qwen3-4B-Instruct-2507 as the proposed alternative to our existing GPT-2 model&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The main reasons for this selection are its downloadable weights, Apache 2.0 licence, instruction-following capabilities, and documented improvements in open-ended text generation.&lt;/p&gt;

&lt;p&gt;Our next step is to integrate Qwen3 into the experimental version of InkMind and compare its output directly with GPT-2. By using the same prompts and evaluation criteria, we can investigate whether the new model generates more relevant, coherent, creative, and varied poems.&lt;/p&gt;

&lt;p&gt;The experiment will help us make an evidence-based decision about the best model for InkMind while strengthening our practical understanding of NLP and modern language models.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;References&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Botpress. (n.d.). &lt;em&gt;&lt;a href="https://botpress.com/blog/best-large-language-models/" rel="noopener noreferrer"&gt;The 10 best large language models (LLMs) in 2026&lt;/a&gt;&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;OpenAI Community. (n.d.). &lt;em&gt;&lt;a href="https://huggingface.co/openai-community/gpt2" rel="noopener noreferrer"&gt;GPT-2 model card&lt;/a&gt;&lt;/em&gt;. Hugging Face.&lt;/li&gt;
&lt;li&gt;Qwen. (n.d.). &lt;em&gt;&lt;a href="https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507" rel="noopener noreferrer"&gt;Qwen3-4B-Instruct-2507&lt;/a&gt;&lt;/em&gt;. Hugging Face.&lt;/li&gt;
&lt;li&gt;Qwen. (n.d.). &lt;em&gt;&lt;a href="https://huggingface.co/Qwen/Qwen3-4B" rel="noopener noreferrer"&gt;Qwen3&lt;/a&gt;&lt;/em&gt;. Hugging Face.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>largelanguagemodel</category>
      <category>nlp</category>
    </item>
    <item>
      <title>From Pixels to Segmentation: My Journey into Computer Vision</title>
      <dc:creator>Marie Claire Uwiringiyimana</dc:creator>
      <pubDate>Tue, 13 Oct 2026 14:40:53 +0000</pubDate>
      <link>https://dev.to/marie_claireuwiringiyima/from-pixels-to-segmentation-my-journey-into-computer-vision-3lao</link>
      <guid>https://dev.to/marie_claireuwiringiyima/from-pixels-to-segmentation-my-journey-into-computer-vision-3lao</guid>
      <description>&lt;p&gt;A research-based learning journey exploring how computers process and interpret images, from pixels and RGB colour channels to mathematical kernels, image filters, object classification, detection, and segmentation. In this blog, I share the concepts I researched, the mathematical foundations I explored, and the key insights I gained while learning how computer vision works.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Introduction&lt;/strong&gt;&lt;br&gt;
Computer vision is a field of artificial intelligence that enables computers to extract useful information from images and videos. A computer does not see an image as a person does; instead, it receives numerical values arranged in a grid.&lt;br&gt;
Image processing applies mathematical operations to these values to improve an image or reveal features such as edges and textures. Deep-learning models can then use these features for tasks such as image classification, object detection, and image segmentation (Gonzalez &amp;amp; Woods, 2018; Szeliski, 2022).&lt;br&gt;
&lt;strong&gt;2. Understanding Pixels and RGB Images&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;2.1 What is a pixel?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;A pixel&lt;/strong&gt;, meaning picture element, is the smallest individual sample in a digital image. An image consists of many pixels arranged in rows and columns.&lt;br&gt;
In an 8-bit grayscale image, each pixel usually stores an intensity value between &lt;strong&gt;0 and 255:&lt;br&gt;
    0: Black&lt;br&gt;
    255: White&lt;/strong&gt;&lt;br&gt;
    Values between 0 and 255: Different shades of gray&lt;br&gt;
A grayscale image can be represented mathematically as: I(x,y) &lt;br&gt;
Where:&lt;br&gt;
    &lt;strong&gt;(I)&lt;/strong&gt; represents the image.&lt;br&gt;
    &lt;strong&gt;(x)&lt;/strong&gt; represents the row position.&lt;br&gt;
    &lt;strong&gt;(y)&lt;/strong&gt; represents the column position.&lt;br&gt;
    &lt;strong&gt;(I(x,y))&lt;/strong&gt; represents the intensity of the pixel at that position.&lt;br&gt;
&lt;strong&gt;2.2 Understanding RGB images&lt;/strong&gt;&lt;br&gt;
RGB stands for Red, Green, and Blue. It is a colour model that represents colours by combining three colour channels.&lt;br&gt;
Each pixel in a standard 8-bit RGB image contains three values:&lt;br&gt;
                             &lt;strong&gt;I(x,y)= [R(x,y), G(x,y), B(x,y)]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Where:&lt;br&gt;
    &lt;strong&gt;R(x,y)&lt;/strong&gt; represents the red intensity.&lt;br&gt;
    &lt;strong&gt;G(x,y)&lt;/strong&gt; represents the green intensity.&lt;br&gt;
    &lt;strong&gt;B(x,y)&lt;/strong&gt; represents the blue intensity.&lt;br&gt;
Each channel usually ranges from 0 to 255.&lt;br&gt;
&lt;strong&gt;Examples:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;RGB value&lt;/strong&gt;   &lt;strong&gt;Colour&lt;/strong&gt;&lt;br&gt;
(255, 0, 0) Red&lt;br&gt;
(0, 255, 0) Green&lt;br&gt;
(0, 0, 255) Blue&lt;br&gt;
(255, 255, 255) White&lt;br&gt;
(0, 0, 0)   Black&lt;br&gt;
(255, 255, 0)   Yellow&lt;/p&gt;

&lt;p&gt;An RGB image can therefore be represented as a three-dimensional array with dimensions: &lt;strong&gt;H×W×3&lt;/strong&gt;&lt;br&gt;
Where &lt;strong&gt;H&lt;/strong&gt; is the image height, &lt;strong&gt;W&lt;/strong&gt; is its width, and &lt;strong&gt;3&lt;/strong&gt; represents the RGB channels.&lt;br&gt;
&lt;strong&gt;2.3 Converting RGB to grayscale&lt;/strong&gt;&lt;br&gt;
Sometimes, image processing algorithms operate on grayscale images because they need intensity information rather than colour information.&lt;br&gt;
A common luminance-weighted conversion formula is:&lt;br&gt;
&lt;strong&gt;(Gray=0.299R+0.587G+0.114B)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Where &lt;strong&gt;(R), (G)&lt;/strong&gt;, and &lt;strong&gt;(B)&lt;/strong&gt; are the red, green, and blue channel values.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
Suppose a pixel has RGB values:&lt;br&gt;
&lt;strong&gt;R=100, G=150, B=200&lt;/strong&gt;&lt;br&gt;
Substituting these values:&lt;br&gt;
&lt;strong&gt;Gray = 0.299(100) + 0.587(150) + 0.114(200)&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Gray = 29.9 + 88.05 + 22.8&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Gray = 140.75 ~ 141&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The resulting grayscale pixel has an intensity of approximately 141.&lt;br&gt;
This weighted formula is associated with standard video luminance calculations, including ITU-R BT.601 (International Telecommunication Union, 2011).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Understanding Kernels and Filters&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;3.1 What is a kernel?&lt;/strong&gt;&lt;br&gt;
A kernel, also called a filter, is a small matrix of numerical values applied to an image to modify its appearance or extract useful features.&lt;br&gt;
For example, a 3×3 kernel contains nine values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;           [ 1  1  1 ]
      K =  [ 1  1  1 ]
           [ 1  1  1 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The kernel moves across the image. At each position, its values are multiplied by the corresponding neighbouring pixel values, and the results are added together.&lt;br&gt;
This operation is used for blurring, sharpening, edge detection, and other image-processing tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.2 General mathematical formula for convolution&lt;/strong&gt;&lt;br&gt;
A two-dimensional convolution can be expressed as:&lt;br&gt;
&lt;strong&gt;O(x, y) = Σᵢ Σⱼ K(i, j) I(x − i, y − j)&lt;/strong&gt;&lt;br&gt;
Where:&lt;br&gt;
    &lt;strong&gt;O(x,y)&lt;/strong&gt; is the output pixel.&lt;br&gt;
    &lt;strong&gt;I(x,y)&lt;/strong&gt; is the input image.&lt;br&gt;
    &lt;strong&gt;K(i,j)&lt;/strong&gt; represents the kernel values.&lt;br&gt;
    &lt;strong&gt;i,j&lt;/strong&gt; represent positions within the kernel.&lt;br&gt;
        &lt;strong&gt;∑&lt;/strong&gt; indicates summation over the kernel positions.&lt;br&gt;
Strict mathematical convolution flips the kernel before applying it. Some image-processing libraries instead perform cross-correlation, which uses the kernel without flipping it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.3 Common image kernels and filters&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;A. Average blur filter&lt;/strong&gt;&lt;br&gt;
Kernel&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                [ 1  1  1 ]
      K = 1/9 × [ 1  1  1 ]
                [ 1  1  1 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This filter calculates the average of a pixel and its eight neighbours. It smooths an image and reduces small details and noise.&lt;/p&gt;

&lt;p&gt;The output pixel is:&lt;br&gt;
&lt;strong&gt;O(x, y) = (1/9) Σᵢ₌₋₁¹ Σⱼ₌₋₁¹ I(x + i, y + j)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;B. Large blur filter (15 × 15)&lt;/strong&gt;&lt;br&gt;
Kernel&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Large Blur Kernel (15 × 15)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;               [ 1  1  ...  1 ]
         1
K =  ─────── ×
       225     [ 1  1  ...  1 ]
               [ ⋮  ⋮   ⋱  ⋮ ]
               [ 1  1  ...  1 ]  ₁₅ₓ₁₅
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This filter averages 225 neighbouring pixels. It produces stronger smoothing than a 3×3 blur and removes more fine details.&lt;br&gt;
The output pixel is:&lt;br&gt;
&lt;strong&gt;O(x, y) = (1/225) Σᵢ₌₋₇⁷ Σⱼ₌₋₇⁷ I(x + i, y + j)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;C. Sharpening filter&lt;/strong&gt;&lt;br&gt;
Kernel&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
      [  0  -1   0 ]
 K =  [ -1   5  -1 ]
      [  0  -1   0 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The sharpening filter strengthens the central pixel and subtracts the four directly adjacent pixels. This emphasizes local changes and makes details appear sharper.&lt;/p&gt;

&lt;p&gt;The output is:&lt;br&gt;
&lt;strong&gt;O(x, y) = 5I(x, y)&lt;br&gt;
          − I(x − 1, y) − I(x + 1, y)&lt;br&gt;
          − I(x, y − 1) − I(x, y + 1)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;D. Sobel X filter&lt;/strong&gt;&lt;br&gt;
Kernel&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     [ -1   0   1 ]
Gₓ = [ -2   0   2 ]
     [ -1   0   1 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Sobel X filter estimates intensity changes along the horizontal direction. It commonly highlights vertical edges in an image.&lt;/p&gt;

&lt;p&gt;The response is:&lt;br&gt;
&lt;strong&gt;Gₓ = Kₓ * I&lt;/strong&gt;&lt;br&gt;
Here, * denotes convolution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;E. Sobel Y filter&lt;/strong&gt;&lt;br&gt;
Kernel&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     [ -1  -2  -1 ]
Gᵧ = [  0   0   0 ]
     [  1   2   1 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Sobel Y filter estimates intensity changes along the vertical direction. It commonly highlights horizontal edges.&lt;br&gt;
The response is:&lt;br&gt;
&lt;strong&gt;Gᵧ = Kᵧ * I&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;F. Gradient magnitude filter&lt;/strong&gt;&lt;br&gt;
After calculating the Sobel X and Sobel Y responses, they can be combined to estimate the strength of an edge.&lt;br&gt;
&lt;strong&gt;G = √(Gₓ² + Gᵧ²)&lt;/strong&gt; &lt;br&gt;
Where:&lt;br&gt;
    &lt;strong&gt;Gₓ&lt;/strong&gt; is the horizontal gradient response.&lt;br&gt;
        &lt;strong&gt;Gᵧ&lt;/strong&gt; is the vertical gradient response.&lt;br&gt;
        &lt;strong&gt;G&lt;/strong&gt; is the gradient magnitude.&lt;br&gt;
Larger gradient magnitudes indicate stronger intensity changes, which often correspond to image edges.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.4 Summary of common filters&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Filter&lt;/th&gt;
&lt;th&gt;Main purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Average blur&lt;/td&gt;
&lt;td&gt;Smooths an image and reduces small details.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Large blur&lt;/td&gt;
&lt;td&gt;Produces stronger smoothing.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sharpening&lt;/td&gt;
&lt;td&gt;Emphasizes details and local changes.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sobel X&lt;/td&gt;
&lt;td&gt;Highlights predominantly vertical edges.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sobel Y&lt;/td&gt;
&lt;td&gt;Highlights predominantly horizontal edges.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gradient magnitude&lt;/td&gt;
&lt;td&gt;Combines edge responses to estimate edge strength.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;4. From Image Processing to Computer Vision&lt;/strong&gt;&lt;br&gt;
Traditional image-processing filters operate directly on pixel values. Modern computer-vision systems often use convolutional neural networks (CNNs), which learn useful filters from training data.&lt;br&gt;
Early network layers may learn edges and textures, while deeper layers combine these features into more complex patterns.&lt;br&gt;
Three important computer-vision tasks are image classification, object detection, and image segmentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.1 Image classification&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Question: What is in the image?&lt;/strong&gt;&lt;br&gt;
Image classification assigns one or more labels to an entire image.&lt;br&gt;
For example, a model might classify an image as:&lt;br&gt;
    A dog&lt;br&gt;
    A car&lt;br&gt;
    A building&lt;br&gt;
    A landscape&lt;br&gt;
Classification generally does not identify the precise location of each object.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.2 Object detection&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Question:&lt;/strong&gt; What objects are present, and where are they located?&lt;br&gt;
Object detection identifies objects and estimates their locations, commonly using bounding boxes.&lt;br&gt;
For example, a traffic image might contain:&lt;br&gt;
                                       Three cars&lt;br&gt;
                                       Two pedestrians&lt;br&gt;
                                       One bicycle&lt;br&gt;
The model returns the object classes and their corresponding locations.&lt;br&gt;
&lt;strong&gt;4.3 Image segmentatio&lt;/strong&gt;n&lt;br&gt;
&lt;strong&gt;Question:&lt;/strong&gt; Which pixels belong to each object or region?&lt;br&gt;
Image segmentation assigns labels to individual pixels, allowing a computer to identify the precise regions occupied by objects.&lt;br&gt;
&lt;strong&gt;Two common forms are:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Semantic segmentation:&lt;/strong&gt; Assigns a class to every pixel, such as road, building, person, or vehicle.&lt;br&gt;
&lt;strong&gt;Instance segmentation:&lt;/strong&gt; Separates individual objects, including different objects belonging to the same class.&lt;br&gt;
For example, in a street photograph, segmentation can label the pixels belonging to roads, buildings, vehicles, and pedestrians.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.4 Comparing the three tasks&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Classification&lt;/td&gt;
&lt;td&gt;Image-level label&lt;/td&gt;
&lt;td&gt;"This is a street scene."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Object detection&lt;/td&gt;
&lt;td&gt;Labels and bounding boxes&lt;/td&gt;
&lt;td&gt;"There is a car at this location."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Segmentation&lt;/td&gt;
&lt;td&gt;Pixel-level labels or masks&lt;/td&gt;
&lt;td&gt;"These pixels belong to the car."&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The main difference is the level of spatial detail: classification identifies the overall content, detection locates objects, and segmentation identifies their regions at pixel level.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. What I Learned&lt;/strong&gt;&lt;br&gt;
All of these things I learned about computer vision helped me understand how computers process and interpret images, from analyzing individual pixels and RGB colour channels to applying mathematical kernels and filters to extract useful visual information.&lt;br&gt;
Through these concepts and practical experiments, I learned how image filters can smooth images, sharpen details, and detect edges. I also understood the differences between image classification, object detection, and image segmentation, and how each technique helps computers understand visual information at a different level.&lt;br&gt;
Working with pretrained models also helped me recognize their limitations. I learned that models can produce incorrect predictions when an image contains information that differs from the patterns or categories learned during training. For this reason, confidence scores should not automatically be considered proof that a prediction is correct.&lt;br&gt;
Most importantly, this learning experience helped me connect mathematical concepts with practical applications. I realized that understanding computer vision requires not only learning the theory but also experimenting with real images, analyzing model outputs, and critically evaluating the results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Conclusion&lt;/strong&gt;&lt;br&gt;
Pixels and colour channels form the numerical foundation of digital images. RGB represents colour using red, green, and blue intensity values, while grayscale represents image intensity using a single channel.&lt;br&gt;
Kernels and filters apply mathematical operations to local groups of pixels. Blur filters smooth images, sharpening filters emphasize details, and Sobel filters estimate edge information.&lt;br&gt;
These fundamental operations help explain how computers process visual information. Building on this foundation, image classification identifies image content, object detection locates objects, and image segmentation assigns labels to individual pixels.&lt;br&gt;
Understanding these concepts provides a strong foundation for studying image processing, convolutional neural networks, and modern computer-vision applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. References&lt;/strong&gt; &lt;br&gt;
Gonzalez, R. C., &amp;amp; Woods, R. E. (2018). Digital image processing (4th ed.). Pearson.&lt;/p&gt;

&lt;p&gt;International Telecommunication Union. (2011). Studio encoding parameters of digital television for standard 4:3 and wide screen 16:9 aspect ratios (ITU-R Recommendation BT.601). &lt;a href="https://www.itu.int/rec/R-REC-BT.601" rel="noopener noreferrer"&gt;https://www.itu.int/rec/R-REC-BT.601&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sobel, I., &amp;amp; Feldman, G. (1968). A 3×3 isotropic gradient operator for image processing. Stanford Artificial Intelligence Project.&lt;/p&gt;

&lt;p&gt;Szeliski, R. (2022). Computer vision: Algorithms and applications (2nd ed.). Springer. &lt;a href="https://szeliski.org/Book/" rel="noopener noreferrer"&gt;https://szeliski.org/Book/&lt;/a&gt; &lt;/p&gt;

</description>
      <category>computervision</category>
      <category>ai</category>
      <category>python</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>From Words to Vectors: Understanding Word Embeddings with FastText</title>
      <dc:creator>Marie Claire Uwiringiyimana</dc:creator>
      <pubDate>Wed, 30 Sep 2026 13:04:30 +0000</pubDate>
      <link>https://dev.to/marie_claireuwiringiyima/from-words-to-vectors-understanding-word-embeddings-with-fasttext-7no</link>
      <guid>https://dev.to/marie_claireuwiringiyima/from-words-to-vectors-understanding-word-embeddings-with-fasttext-7no</guid>
      <description>&lt;p&gt;When I started learning Natural Language Processing (NLP), one question I had was, "How can a computer work with words when computers understand numbers better than human language?"&lt;/p&gt;

&lt;p&gt;This is where &lt;strong&gt;word embeddings&lt;/strong&gt; come in. Word embeddings are a way of representing words as numerical vectors. Instead of giving a machine only the word "cat," we represent it using a list of numbers. These numbers allow machine-learning models to work with words mathematically and learn relationships between them [1].&lt;/p&gt;

&lt;p&gt;For example, a word could have a representation like&lt;/p&gt;

&lt;p&gt;cat → [0.21, 0.45, -0.13, 0.72, ...]&lt;/p&gt;

&lt;p&gt;A real embedding can contain hundreds of numbers. The important thing is not what one individual number means, but the position of the whole vector in the vector space. Words that have similar meanings or are used in similar contexts can have similar vector representations [1].&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Do Word Embeddings Matter?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before learning about embeddings, I looked at one-hot encoding. With one-hot encoding, every word is represented using a vector containing mostly zeros and one value of 1.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;cat → [1, 0, 0]&lt;br&gt;
dog → [0, 1, 0]&lt;br&gt;
banana → [0, 0, 1]&lt;/p&gt;

&lt;p&gt;This tells the computer that the words are different, but it does not show that "cat" and "dog" are more related than "cat" and "banana."&lt;/p&gt;

&lt;p&gt;Word embeddings provide a better representation because they can learn relationships between words from how those words are used in text. They also use dense vectors with fewer dimensions than a vocabulary-sized one-hot representation, making them more useful for machine-learning applications [1].&lt;/p&gt;

&lt;p&gt;This is important for NLP tasks such as text classification, sentiment analysis, search, machine translation, and other applications that need numerical representations of language [1].&lt;/p&gt;

&lt;p&gt;A famous example of relationships captured by word embeddings is:&lt;/p&gt;

&lt;p&gt;king - man + woman ≈ queen&lt;/p&gt;

&lt;p&gt;This does not mean that every embedding model will produce this exact result, but it shows how vector representations can capture useful relationships between words [2].&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Embedding Method I Chose: FastText&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;FastText is based on the skip-gram approach and extends the idea of word embeddings by using subword information. Instead of looking at a word only as a complete unit, FastText also represents a word using character n-grams [3].&lt;/p&gt;

&lt;p&gt;A character n-gram is simply a group of consecutive characters.&lt;/p&gt;

&lt;p&gt;For example, parts of:&lt;/p&gt;

&lt;p&gt;playing&lt;/p&gt;

&lt;p&gt;can include:&lt;/p&gt;

&lt;p&gt;pla&lt;br&gt;
lay&lt;br&gt;
ayi&lt;br&gt;
yin&lt;br&gt;
ing&lt;/p&gt;

&lt;p&gt;The exact n-grams depend on the model settings.&lt;/p&gt;

&lt;p&gt;This is useful because related words often share parts of their spelling:&lt;/p&gt;

&lt;p&gt;play&lt;br&gt;
played&lt;br&gt;
playing&lt;br&gt;
player&lt;br&gt;
plays&lt;/p&gt;

&lt;p&gt;FastText can learn information from these shared character patterns. This is especially useful for rare words and words that were not directly seen during training [3].&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My Python Experiment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I used the gensim Python library to train a small FastText model on a few example sentences. The model was configured with 100-dimensional word vectors, a context window of 3, and the Skip-gram approach.&lt;/p&gt;

&lt;p&gt;After training, I used most_similar() to find the words closest to “playing”. In my experiment, “plays” had the highest similarity score, followed by “played”, “love”, “scored”, and “player”. The similarity scores show how close their learned vector representations are.&lt;/p&gt;

&lt;p&gt;I also inspected the vector generated for “playing”. The model represents the word as a list of numerical values rather than as text. Since I used vector_size=100, the complete representation contains 100 values.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I Found Interesting&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I then tested “playingly”, a word that was not included in my original training sentences. FastText was still able to generate a vector for it. This helped me understand one of the main advantages of FastText: it uses character n-grams (subword information) to build word representations. This means the model can make use of parts of a word, even when the complete word was not seen during training [3][4].&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The screenshots below show the actual code and outputs from my Jupyter Notebook.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F75b1bt6le64ywfqaxulq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F75b1bt6le64ywfqaxulq.png" alt=" " width="800" height="366"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp0orp97vgbb65ozdst7y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp0orp97vgbb65ozdst7y.png" alt=" " width="800" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;            **Figure 1**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;What I Learned&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before working with embeddings, I thought a vector was simply a list of numbers and did not understand how those numbers could represent language.&lt;/p&gt;

&lt;p&gt;One thing I learned is that we should not try to give every individual number a specific human meaning. The whole vector is what matters.&lt;/p&gt;

&lt;p&gt;I also initially found character n-grams confusing. I was thinking about words as complete units, but FastText showed me that words can also be understood through smaller pieces. For example, words such as "play," "played," "playing," and "player" share many character patterns.&lt;/p&gt;

&lt;p&gt;This made me understand why FastText can be useful for languages and datasets containing rare words, different word forms, or words that may not appear frequently in the training data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Word embeddings provide a way to connect human language with machine learning by representing words as numerical vectors. Instead of treating every word as completely independent, embeddings can capture relationships based on how words are used.&lt;/p&gt;

&lt;p&gt;FastText extends this idea by using character n-grams, allowing it to learn from smaller parts of words. My small Python experiment helped me see this concept in practice rather than only reading about it.&lt;/p&gt;

&lt;p&gt;My main takeaway is simple:&lt;/p&gt;

&lt;p&gt;Words&lt;br&gt;
  ↓&lt;br&gt;
Context + subword information&lt;br&gt;
  ↓&lt;br&gt;
Numerical vectors&lt;br&gt;
  ↓&lt;br&gt;
Compare relationships.&lt;br&gt;
  ↓&lt;br&gt;
NLP applications&lt;/p&gt;

&lt;p&gt;For me, the biggest lesson was that word embeddings are not just about converting words into numbers. They are about creating numerical representations that allow machines to work with relationships in language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;[1] IBM. What Are Word Embeddings?&lt;/p&gt;

&lt;p&gt;[2] Mikolov, T., Chen, K., Corrado, G., &amp;amp; Dean, J. (2013). Efficient Estimation of Word Representations in Vector Space.&lt;/p&gt;

&lt;p&gt;[3] Bojanowski, P., Grave, E., Joulin, A., &amp;amp; Mikolov, T. (2017). Enriching Word Vectors with Subword Information.&lt;/p&gt;

&lt;p&gt;[4] Gensim Documentation. FastText Model and Similarity Operations.&lt;/p&gt;

</description>
      <category>nlp</category>
      <category>machinelearning</category>
      <category>python</category>
    </item>
    <item>
      <title>word embedding project</title>
      <dc:creator>Marie Claire Uwiringiyimana</dc:creator>
      <pubDate>Wed, 30 Sep 2026 12:33:06 +0000</pubDate>
      <link>https://dev.to/marie_claireuwiringiyima/word-embedding-project-1jao</link>
      <guid>https://dev.to/marie_claireuwiringiyima/word-embedding-project-1jao</guid>
      <description>&lt;p&gt;w&lt;/p&gt;

</description>
    </item>
    <item>
      <title>word embedding project</title>
      <dc:creator>Marie Claire Uwiringiyimana</dc:creator>
      <pubDate>Wed, 30 Sep 2026 09:45:03 +0000</pubDate>
      <link>https://dev.to/marie_claireuwiringiyima/word-embedding-project-26jn</link>
      <guid>https://dev.to/marie_claireuwiringiyima/word-embedding-project-26jn</guid>
      <description></description>
    </item>
  </channel>
</rss>
