Skip to content

Aircraft detection in satellite images using computer vision and machine learning.

License

Notifications You must be signed in to change notification settings

giusalfieri/IPA_Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitHub stars GitHub contributors GitHub repo size GitHub License

This project focuses on detecting aircraft in satellite images using various Computer Vision and Machine Learning techniques. The workflow includes data preprocessing, feature extraction, clustering, and classification using Support Vector Machines (SVMs).

Note

The SVM used in this project is part of the ucasML command-line interface (CLI) tool.

ucasML Logo

Important

For detailed instructions on installing ucasML tool on your machine, please refer to the ad hoc README.


For a detailed reference of all functions, please refer to the API Documentation.


πŸ“š Table of Contents


Introduction

The aim of this project is to develop an automated system for detecting aircraft in satellite imagery. The project utilizes a combination of image processing techniques, feature extraction methods, and machine learning algorithms to achieve high accuracy in aircraft detection.


  • Straight airplanes Extraction: Extract straightened airplanes from the training dataset images.
  • Clustering: Perform K-Means clustering based on size and intensity on the airplanes previously extracted.
  • Image Resizing: Resize images within each cluster to uniform dimensions.
  • Eigenplanes Generation: Generate eigenplanes for the clustered images.
  • SVM Training Data Extraction: Extract data from CSV for SVM training.
  • Performance Evaluation: Evaluate the performance of the classifier.

Note

The training dataset used is a sub-set of the training dataset of HRPlanesv2 Data Set.

Important

For a detailed description of the underlying ratio of design choices taken, see project_report.pdf.


OpenCV CMake C++20 Python 3.x

Ensure you have the above installed on your machine.

Important

Make sure Python is installed system wide (e.g., on Windows, Python must be added to the system PATH).

For detailed instructions on how to install OpenCV on your machine, please refer to this guide.

Tip

Click the badges to visit their official websites.

For a list of C++20 compliant compilers, click here.


Command Line Instructions
  1. Clone the repository:

    git clone https://github.com/giusalfieri/IPA_Project.git
    cd IPA_Project
  2. Create a build directory:

    mkdir build
    cd build
  3. Configure the project using CMake:

    cmake ../src
  4. Compile the project:

    make
  5. Run the project:

    ./aircraft_detection_project [step1] [step2] ...

    For example, to run the entire pipeline, see the Usage below.

CMake GUI and Visual Studio Instructions
  1. Clone the repository:

    git clone https://github.com/giusalfieri/IPA_Project.git
    cd IPA_Project
  2. Open CMake GUI:

    • Set the "Where is the source code" field to the path of the IPA_Project directory.
    • Set the "Where to build the binaries" field to a new build directory within the IPA_Project directory (e.g., IPA_Project/build).
  3. Configure the project:

    • Click on the "Configure" button.
    • Select your version of Visual Studio (e.g., Visual Studio 2022) and the appropriate platform (e.g., x64).
    • Click "Finish" to complete the configuration process.
    • If there are any missing dependencies, resolve them and click "Configure" again.
  4. Generate the project files:

    • Once the configuration is complete, click the "Generate" button to create the Visual Studio solution and project files.
  5. Open the project in Visual Studio:

    • Navigate to the build directory and open the generated .sln file (e.g., IPA_Project.sln) with Visual Studio.
  6. Build the project:

    • In Visual Studio, set the build configuration to Release or Debug as needed.
    • Build the solution by selecting "Build Solution" from the "Build" menu.
  7. Run the project:

    • In Visual Studio, set the startup project to aircraft_detection_project.
    • Start debugging or run the project without debugging as needed.
    • For an example of the command-line arguments to run the entire pipeline, see the Usage below.

To run the entire pipeline, use the following command in the directory where the executable is located:

./aircraft_detection_project extractStraightAirplanes KMeansBySize KMeansByIntensity resizeImagesInClusters generateEigenplanes extract_SVM_Training_Data Performance_evaluation

Or you can run individual steps as needed. See the Pipeline section for the exact order in which the steps should be executed.

Note

It is strongly suggested to execute the steps one by one, as some of them are computationally intensive. For example, extract_SVM_Training_Data involves template matching for numerous images, each with many airplane templates.


The steps in the pipeline must be executed in the following order to ensure the correct functioning of the process:

  1. extractStraightAirplanes
  2. KMeansBySize
  3. KMeansByIntensity
  4. resizeImagesInClusters
  5. generateEigenplanes
  6. extract_SVM_Training_Data
  7. Performance_evaluation

Make sure to follow this precise order when running the steps.

Important

After each phase completes, a .done file is created in the /src/steps_completed folder. When a command is issued, the program verifies the previous step's completion by checking for the corresponding .done file. If the file is missing, a warning message indicates the unmet prerequisite.

Note

The step extractStraightAirplanes has already been completed by us, and its .done file is already present inside /src/steps_completed folder. Furthermore, the straight airplanes extracted by us, must be downloaded from a Google Drive folder: see this README.md.

Important

Please ensure that the folders /src/dataset_trainingand /src/dataset_for_straight_airplanes_extraction are populated as specified in their respective README files: dataset_training README and dataset_for_straight_airplanes_extraction README.

Important

The output of the SVM in cross-validation mode are two .sco files. Rename them positive.sco and negative.sco and put them inside /src/svm_cv_outputs directory.

A detailed description of each step can be found by invoking the executable with the --help option:


Name GitHub
Giuseppe Alfieri @giusalfieri
Paolo Simeone @bonoboprog
Aurora Pisa @aurorapisa
Riccardo D'Aguanno @ricdag8
Gianmarco Luongo @GianmarcoL

This project is licensed under the MIT License. See the LICENSE file for details.