RS HR (Remote Sensing High Resolution) Object Detection
YOLO model architectures are used to predict the annotation of bounding box (rectangle) of the certain specific objects in the image. Here, only binary classification is used between two classes: Lake and River, for Bhuvan images (moved to v1).
NOTE: A third class "Vegetation" is removed, as its definition and marking in the annotation is completely pointless, and somewhat incorrect and would confuse the model more.
For the DIOR dataset, it consist of 20 classes of Remote Sensing data along with annotation.
The idea is to detect how good the model is to detect specific objects along with generalized objects with close bounding box links.
- Python 3.x or greator.
- Libraries:
pip install -r requirements.txt
(For v1 model)
git clone https://github.com/ultralytics/yolov5
to clone the model architecture and utilities inModel_Data
folder.
- The dataset is hand-picked using the Bhuvan portal.
- The images are then manually annotated with the respective classes using CVAT.
- Another dataset, DIOR is used that consists of more than 20,000 images with 800 x 800 px for detecting actual model accuracy.
NOTE: The Bhuvan dataset used is REALLY small. 10 different 1124 x 1124 px images are used, which are then tiled to ~100 images (training and validation combined). To prevent overfitting, the images are tiled only after splitting in train and validation.
- v1 Model is Yolov5 model initially used. It is a predecessor of Yolov8 model.
- Model folder consist of Yolov8 model along with the Datasets and training notebooks.
- Train_Model.py
- Training configuration for low-end GPU.
- Train_Model_NB.ipynb
- Model trained for 50 epochs.
- Train_Model_NB_1.ipynb
- Same model trained for additional 20 epochs (total 70).
- Train_Model_NB_2.ipynb
- Same model trained for more additional 20 epochs (total 90).
- Train_Model_NB_3.ipynb
- Model trained for 20 epochs. Tiled images are used (512 x 512 px).
- Train_Model_NB_nodfl.ipynb
- Model trained for 50 epochs. DFL loss function is removed.
- Train_Model.py
python .\Model\Dataset\dataset.yaml --weights .\Model\Model_Data\yolov5s.pt
to train the model. The best weights will be saved in.\yolov5\runs\train\exp\weights\best.pt
.python .\Model\Model_Data\yolov5\detect.py --source .\Model\Model_Data\best.pt --conf 0.2
to run the inference on the images folder and detect the classes. For this model, the optimal confidence is0.2
.
- detect.py to detect the images in Sample Images folder. Results folder will contain the detected image and generate a XML file of their annotation along with other metadata.
- read_xml.py contains a sample code to read one of the XML file in the Results folder.
The Bhuvan dataset is always tiled.
- Samyak Waghdhare
- Giridhar Bargaley
- Rudra Shrivastava