About Dataset
The dataset comprises images generated using computational fluid dynamics (CFD) simulations for two cases: flow past an elliptic cylinder and flow past an aerofoil. Here are the details:
Elliptic Cylinder Dataset:
Images: 124 for low speed flow and 124 for high speed flow. Conditions: Simulated for Reynolds numbers of 200 (low speed) and 5000 (high speed).
Aerofoil Dataset:
Images: 250 for low speed flow and 250 for high speed flow. Conditions: Simulated under similar Reynolds number settings of 200 and 5000 for low speed and high speed flows, respectively.
The datasets were generated and captured via CFD simulations using OpenFOAM software. Images were post-processed with ParaView to standardize resolution.
Kaggle Link to the dataset: https://www.kaggle.com/datasets/palanithanarajk/fluid-flow-images
This section includes an explanation of the purpose, environment setup, and how the code works.
This repository contains a Jupyter Notebook (main_file.ipynb
) that classifies fluid flow images as either low-speed or high-speed using Local Binary Pattern (LBP) features and several machine learning classifiers.
- Objective: To classify fluid flow images into low-speed or high-speed categories using computer vision and machine learning.
- Data Source: The data is sourced from the Kaggle dataset available at
Kaggle dataset
. - Features: Extracted using the Local Binary Pattern (LBP) method.
- Classifiers: k-NN, SVM (linear), and Random Forest.
- Python Version:
3.10.12
- Key Libraries:
numpy
pandas
skimage
scikit-learn
matplotlib
time
Ensure you have these libraries installed. You can install them using pip if necessary:
pip install numpy pandas scikit-image scikit-learn matplotlib
or
pip install -r requirements.txt
Directories are structured as follows:
- Elliptic Data:
- Path:
cfd_flow_image_analysis\data\elliptic\
- Path:
- Aerofoil Data:
- Path:
cfd_flow_image_analysis\data\aerofoil\
- Path:
-
Load Images:
- Iterates over all images in Laminar and Turbulent folders.
- Converts images to grayscale.
-
Local Binary Pattern (LBP):
- Calculates LBP for each image with 8 points and radius 1.
- Generates a histogram of LBP values for feature vector.
-
Collect Features:
- Appends LBP histograms to feature list
X
. - Appends labels (0 for low-speed, 1 for high-speed) to
y
.
- Appends LBP histograms to feature list
-
Classifiers:
- k-NN
- SVM (linear)
- Random Forest
-
Grid Search:
- Performs hyperparameter tuning using cross-validation.
- Selects optimal parameters based on cross-validation score.
-
Performance Metrics:
- Accuracy, Precision, Recall, F1 Score, Specificity, and AUC are calculated.
- Confusion matrices are plotted with enhanced readability.
-
Output:
- Prints evaluation metrics and best hyperparameters for each classifier.
- Generates confusion matrix plots.
- Ensure the Kaggle environment is properly set up to access the dataset.
- The code is optimized for execution in environments that support Jupyter Notebooks, such as Kaggle Notebooks or Google Colab.
- Run the Jupyter Notebook (
main_file.ipynb
). - Review the printed metrics and saved plots in the output files.
- Experiment with different LBP parameters or alternative feature extraction techniques.
If you use this code in your research, please cite the following paper:
Palani Thanaraj K. (2025). Fluid Flow Image Classification Using LBP Features. GitHub repository.
<https://github.com/palanithanarajk/cfd_flow_image_analysis>
- GitHub Link: GitHub Repository
This project is distributed under the terms of the GNU General Public License v3.0 (or any later version).
You can find a copy of the GNU GPL v3.0 here.
By using, modifying, or distributing this project, you agree to be bound by the terms of the GPL v3.0.
This documentation provides a comprehensive overview of the project, ensuring clarity and usability for anyone interested in using or contributing to the codebase.