Skip to content

This project uses a custom-trained ResNet18 to classify different types of rocks into 7 subclasses and optionally into 3 main rock types: Igneous, Metamorphic and Sedimentary. It's built with PyTorch and tested on a dataset of rock images.

Notifications You must be signed in to change notification settings

Kreytorn/Rock-clasification-with-ResNet18

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸͺ¨ Rock Classification with ResNet18

A simple PyTorch project that classifies rocks by image using a ResNet18 model. The model can predict both:

  • Main class: Igneous, Metamorphic, Sedimentary
  • Subclass: Basalt, Granite, Marble, Quartzite, Coal, Limestone, Sandstone

πŸ“ Folder Structure

  • Dataset/ β†’ Rock image dataset
  • archive/Dataset/ β†’ Backup copy of the dataset
  • models/
    • rock_resnet18_mainclass.pth β†’ predicts main rock classes (3)
    • rock_resnet18_subclass.pth β†’ predicts detailed subclasses (7)
  • notebooks/
    • resnet18.ipynb β†’ model training
    • preprocessing.ipynb β†’ resizing, normalization, splitting
    • data_augmentation.ipynb β†’ flipping, rotation, brightness

πŸ§ͺ How to Use

Open the notebooks in Jupyter or VS Code and run:

  • resnet18.ipynb to train or evaluate
  • Make sure you have the dataset and models in place

πŸ”§ Requirements

Install required libs with:

pip install torch torchvision matplotlib

About

This project uses a custom-trained ResNet18 to classify different types of rocks into 7 subclasses and optionally into 3 main rock types: Igneous, Metamorphic and Sedimentary. It's built with PyTorch and tested on a dataset of rock images.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published