This repository contains code and resources for detecting and classifying land mines. The primary goal is to analyze and classify data derived from ground-penetrating radar and other sensors. The codebase supports machine learning techniques to ensure accurate and efficient classification. This project utilizes a Vision Transformer (ViT) model for classifying land mines using image data. The ViT model, specifically the vit_b_16 variant from the PyTorch torchvision library, is employed with pretrained weights as a feature extractor. The method involves:
- Preprocessing: Sensor data is preprocessed and resized to match the ViT input dimensions (e.g., 224x224 pixels for images).
- Feature Extraction: The pretrained ViT processes the input data to extract high-dimensional features using its transformer-based architecture, which excels at capturing long-range dependencies and spatial patterns.
- Classifier Training: A custom classification head is trained on top of the extracted features to classify the presence of land mines in a binary manner.
- Evaluation: The model is evaluated using standard performance metrics such as accuracy, precision, and recall, ensuring its robustness and reliability for land mine detection tasks.
Data: Free zone, 0cm depth mine, 1cm depth mine, 5cm depth mine, 10 cm depth mine
- Phase 1 of classification: Free zone vs. Land mine (all mine classes)
Train accuracy: 93%
Test accuracy: 84%
- Phase 2 of classification: Surface mine (0cm & 1cm depth) vs. Deep mine (5cm & 10cm depth)
Train accuracy: 86%
Test accuracy: 75%
The data used in this project is sourced from the following publication:
- Title: Land Mine Detection Dataset
- Source: ScienceDirect
The dataset contains sensor readings and annotations that are used for training and validating machine learning models.
To access the dataset:
- Visit the dataset link.
- Follow the instructions on the website to download the data.
The pre-trained ViT classifier was used. Through transfer-learning, all the layers were frozen. Then the head layer was modified for 2 classes and a drop-out with 20% probability.
Land_mine_main.ipynb
: Main notebook containing the code for data preprocessing, model training, evaluation, and visualization.data/
: Directory where raw and processed data files should be placed (not provided in this repo).Land_mine_data_management_functions.py/
: Python functions for data management for this project. Data automatically is copied into train and test folders.going_modular/data_setup.py/
: Python functions to pre-process the images.going_modular/engin.py/
: Python functions to run the classification model (train and test).
-
Clone the repository:
git clone https://github.com/yourusername/land-mine-detection.git cd land-mine-detection
-
Place the downloaded dataset in the
data/
folder. -
Open
Land_mine_main.ipynb
in Jupyter Notebook or any compatible environment. -
Run the notebook cells step by step to preprocess the data, train the model, and evaluate its performance.
- Model accuracy, precision, and recall metrics are reported in the notebook.
- Visualization of classification results is provided for better interpretability.
Contributions are welcome! Please fork the repository and create a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE
file for details.
- Thanks to the authors of the dataset publication for providing the data.
- Inspired by advancements in ground-penetrating radar technology and machine learning.