Skip to content

Kmoon-7/SwirlDetection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

SwirlDetection

Machine Learning project - University of Bologna (a.y. 2024-25)

Deep learning neural network for swirl detection and analysis using U-Net architecture.

Description

This project implements a neural network (U-Net) for detecting image manipulations with swirl effects applied at variable positions, intensity and sizes. The network returns a binary mask that localizes the defected regions.

Achieved Results: Mean IoU of 0.9146 ± 0.0134 on test set

Model Architecture

The model uses an optimized U-Net architecture tailored for this task:

Input: 128×128×3
    ↓
Encoder:
    - ConvBlock(16) → MaxPool
    - ConvBlock(32) → MaxPool
    - ConvBlock(64) → MaxPool
    ↓
Bottleneck:
    - SeparableConv2D(1×1, 3×3, 5×5) × 2
    ↓
Decoder:
    - UpConv(64) + Skip → ConvBlock
    - UpConv(32) + Skip → ConvBlock
    - UpConv(16) + Skip → ConvBlock
    ↓
Output: Conv2D(1, sigmoid) → 128×128×1

Dataset and Preprocessing

Dataset

Property Value
Source TensorFlow Flowers dataset
Split 3000 train / 300 validation / 370 test
Resolution 128×128×3 pixels

Swirl Defect Parameters

Parameter Value
Max radius 32 pixels
Max strength 4
Center Random position

Training

Parameter Value
Epochs 70 (50 + 20 additional)
Batch size 32
Optimizer Adam
Loss function Dice Loss

Results

Metric Value
Test Mean IoU 0.9146 ± 0.0134
Val Mean IoU Peak 0.9511 (epoch 61 of 70)
Total Parameters 585,073

Requirements and Installation

Dependencies

tensorflow>=2.8.0
scikit-image>=0.19.0
matplotlib>=3.5.0
numpy>=1.21.0
tensorflow-datasets>=4.6.0

Setup

git clone <repository-url>
cd SwirlDetection
pip install -r requirements.txt
jupyter notebook SwirlDetection.ipynb

About

A deep learning neural network for swirl detection and analysis using U-Net architecture.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors