Code Monkey home page Code Monkey logo

orsolamborrini / master-thesis-rcm Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 48.3 MB

Code for Master Degree thesis on the feasibility of automatic sensitive content detection in colonial photographic archives through Image Classification algorithms.

License: GNU General Public License v3.0

Jupyter Notebook 100.00%
computer-vision image-classification machine-learning-projects machine-learning archival-sciences colonial-archives sensitive-content-detection

master-thesis-rcm's Introduction

"Revealing contested memory" Master thesis - Github repository

This repository contains the code for the project "Revealing contested memory: Automatic sensitive content detection in colonial photographic archives", aiming at experimenting with the fine-tuning of different Machine Learning models (specifically, Computer Vision models) to assess the feasibility of automatic sensitive content detection in colonial photographic archives.

The project was developed as final thesis for the Master "Digital Humanities and Digital Knowledge", at Alma Mater Studiorum - University of Bologna.

๐Ÿง Abstract

Although many European archival institutions hold plenty of visual materials on colonial domination, these assets are frequently difficult to access and use due to not only privacy, copyright, commercial and technical issues, but also to ethical concerns: when handling such unsettling and sensitive content, a discussion on the ethics of care and looking should be addressed, especially in relation to the digitisation of colonial archives with a focus on confronting power dynamics and amplifying underrepresented voices. The large scale of the digital archival collections originated from the digitisation efforts conducted by GLAM institutions since the 1990s marks the imperative of machine reasoning for record selection, appraisal, and management of the records. In this context, the use of Machine Learning (ML) techniques can also assist in the detection of potentially sensitive contents.

๐ŸŽˆ Usage

The four Jupyter Notebook files showcase the different phases of the project: from the annotated data (which was annotated through Label Studio) to the error analysis of the fine-tuned ML models.

  • 1_data_cleaning.ipynb
    • Data cleaning and processing performed on the annotated data (in the form of CSV files, one for each archival collection) to prepare it for the creation of the dataset: specifically, corrupted images were deleted, unnecessary information was removed to improve readability, new columns with information on the collection of provenance of each image were added, and the files were all moved to a common folder pictures with all the information stored in a new index.csv file
  • 2_dataset_creation.ipynb
    • The prepared data was split into three sets (namely: train, validation, and test sets), updating the information in the index.csv file. Given the data imbalance, this operation was performed through a stratified split: the class proportions of the dataset population are thus preserved and the risk of not having any instance of the least populated class in the train set is avoided. Finally, images are split in different folders based on their set and class: the dataset, therefore, has a folder-based structure.
  • 3_training.ipynb
    • Experimenting with the ResNet architecture with different hyperparameter configurations. The best performing model is then validated and evaluated on the test set via precision, recall, f1 (both micro and macro average) and accuracy and confusion matrices are produced. All of the experiments are accessible for further examination on a public interactive Weights & Biases dashboard.
  • 4_error_analysis.ipynb
    • For each class of the test set, the model's predictions (and the predicted score for each class for each instance) are analysed in order to understand the possible errors in detection

โ›๏ธ Requirements

  • Python 3.11.5

Run the command:

pip install -r requirements.txt

master-thesis-rcm's People

Contributors

orsolamborrini avatar

Stargazers

Aditya avatar

Watchers

Giovanni Colavizza avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.