Digitala Vetenskapliga Arkivet

Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Automatisk skadedetektering av pennor med maskininlärning
University of Borås, Faculty of Textiles, Engineering and Business.
University of Borås, Faculty of Textiles, Engineering and Business.
2026 (Swedish)Independent thesis Basic level (university diploma), 10 credits / 15 HE creditsStudent thesisAlternative title
Automatic Damage Detection of Pencils Using Machine Learning (English)
Abstract [sv]

Automatiserad bildklassificering kan användas som stöd inom kvalitetskontroll för att identifiera defekta produkter och analysera olika typer av avvikelser. Syftet med detta arbete var att jämföra prestandan hos DT, SVM och CNN vid binär bildklassificering av pennor samt undersöka hur modellernas prestanda förändrades när klassificeringen utökades till multiklassklassificering. Klassificeringen genomfördes först som en binär uppgift, där pennorna delades in i klasserna hel och bruten. Därefter utökades uppgiften till multiklassklassificering, där den brutna klassen delades upp i bruten typ 1 och bruten typ 2. För SVM och DT användes HOG för att extrahera bildegenskaper, medan CNN tränades direkt på bilddata. Modellerna utvärderades genom flera körningar med hjälp av noggrannhet, precision, recall, F1-värde och confusion matrices.Resultaten visade att CNN presterade bäst i genomsnitt vid den binära klassificeringen och hade högst recall för den brutna klassen. Detta innebär att CNN hade bäst förmåga att identifiera brutna pennor i den binära delen av studien. DT och SVM låg något lägre i flera mått, men DT visade mer stabila resultat mellan körningarna. Vid multiklassklassificering gav den mer detaljerade klassindelningen en tydligare bild av hur modellerna hanterade olika defekttyper. Bruten typ 2 identifierades med hög recall av samtliga modeller när den fick en egen klass. Samtidigt visade resultaten att CNN hade större variation mellan körningarna. Även om CNN hade högst genomsnittlig noggrannhet i multiklassdelen var skillnaden mot DT liten, samtidigt som DT visade betydligt stabilare resultat. DT framstod därför som det mest balanserade alternativet i multiklassdelen av studien, eftersom modellen nådde nära samma resultat som CNN men med enklare uppbyggnad, högre tolkningsbarhet och lägre variation. Arbetet visar därmed att bildbaserad maskininlärning kan användas för klassificering av pennor på det aktuella datasetet, men att resultatet påverkas av modellval, klassindelning, datamängd och förbehandling. Slutsatserna bör därför tolkas utifrån studiens förutsättningar och inte som ett generellt svar på vilken modell som är bäst för all bildbaserad defektklassificering.

Abstract [en]

Automated image classification can be used as a support tool in quality control to identify defective products and analyze different types of deviations. The purpose of this thesis was to compare the performance of DT, SVM and CNN in binary image classification of pencils, and to examine how the models’ performance changed when the classification task was extended to multiclass classification. The classification was first performed as a binary task, where the pencils were divided into the classes whole and broken. The task was then extended to multiclass classification, where the broken class was divided into broken type 1 and broken type 2. For SVM and DT, HOG was used to extract image features, while the CNN model was trained directly on image data. The models were evaluated through several runs using accuracy, precision, recall, F1-score and confusion matrices. The results showed that CNN achieved the highest average performance in the binary classification and had the highest recall for the broken class. This means that CNN had the strongest ability to identify broken pencils in the binary part of the study. DT and SVM achieved slightly lower results in several metrics, but DT showed more stable performance between runs. In the multiclass classification, the more detailed class division provided a clearer view of how the models handled different defect types. Broken type 2 was identified with high recall by all models when it was treated as a separate class. At the same time, CNN showed greater variation between runs. Although CNN achieved the highest average accuracy in the multiclass task, the difference compared with DT was small, while DT showed considerably more stable results. Therefore, DT appeared to be the most balanced alternative in the multiclass part of the study, as it achieved results close to CNN while having a simpler structure, higher interpretability and lower variation. This thesis shows that image-based machine learning can be used for pencil classification on the current dataset, but that the results are affected by model choice, class division, data size and preprocessing. The conclusions should therefore be interpreted within the conditions of this study, rather than as a general answer to which model is best for all image-based defect classification tasks.

Place, publisher, year, edition, pages
2026.
Keywords [sv]
Maskininlärning, Bildklassificering, Convolutional Neural Network, Support Vector Machine, Decision Tree
National Category
Engineering and Technology
Identifiers
URN: urn:nbn:se:hb:diva-35814OAI: oai:DiVA.org:hb-35814DiVA, id: diva2:2082930
Subject / course
Maskinteknik - Högskoleingenjör
Supervisors
Examiners
Available from: 2026-07-01 Created: 2026-07-01 Last updated: 2026-07-01Bibliographically approved

Open Access in DiVA

fulltext(2202 kB)15 downloads
File information
File name FULLTEXT01.pdfFile size 2202 kBChecksum SHA-512
a01472d5c7183199acc8af82dfdee63bc3738160644a2ec69bd71a479908d853b5897eebfd0d42cf0dc20c81c52f60fb215fd7b38928079b87b9653816b8af2a
Type fulltextMimetype application/pdf

By organisation
Faculty of Textiles, Engineering and Business
Engineering and Technology

Search outside of DiVA

GoogleGoogle Scholar
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 521 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf