Features
Image Preprocessing: Utilizes techniques such as image acquisition, low-pass filtering, Gabor filtering, and color quantization for preparing soil images for classification. Feature Extraction: Extracts texture features from soil images using statistical parameters like mean amplitude, HSV histogram, and standard deviation. Classification Model: Employs SVM for the classification of soils into various categories based on their textural and color features, aiming for high accuracy in distinguishing between types like Silty Sand, Sandy Clay, Peat, and others. Dataset: The model is trained and evaluated on a dataset comprising 175 soil sample images, including categories such as Clay, Peat, Sandy Clay, and Silty Sand, among others. The dataset's diversity ensures the model's robustness and applicability to real-world soil analysis.
This guide provides detailed instructions for running the soil classification model locally, which was initially developed in Google Colab. The model employs Support Vector Machine (SVM) for classifying soil types based on image data.
Ensure you have Python 3.x and Jupyter Notebook installed on your local machine. If not, you can download Python from the official site and install Jupyter Notebook using pip:
pip install notebookClone or download the GitHub repository containing the .ipynb file and any accompanying files (like the requirements.txt for Python dependencies).
Navigate to the repository's root directory in your terminal or command prompt and install the required Python libraries. If a requirements.txt file is provided, use the following command:
pip install -r requirements.txtIf not, install the necessary libraries individually:
pip install scikit-learn numpy opencv-python matplotlibIn your terminal or command prompt, navigate to the cloned repository's directory and start Jupyter Notebook:
jupyter notebookIn the Jupyter interface that opens in your browser, navigate to and open the .ipynb file (e.g., ReNewed_Soil_Classification_Model.ipynb).
Run the notebook cells in sequence by pressing Shift + Enter for each cell or using the "Run" button in the toolbar. Follow any additional instructions or comments within the notebook.
- Image Source: Ensure you have access to the images you wish to classify. If the project includes a dataset or images, follow the provided links or instructions to download them.
- Image Format: Check the notebook or project documentation for any specific requirements regarding image format, size, or preprocessing steps.
- Modify any file paths in the notebook to point to the location of your images on your local machine. This typically involves changing variables or parameters in the code cells responsible for loading images.
- If the notebook includes Colab-specific commands for file upload (e.g.,
from google.colab import files), you'll need to replace or remove these commands. Instead, use OpenCV (cv2.imread()) or similar libraries to read images from your filesystem.
- Compatibility: Ensure your local Python environment matches the one used in Colab (e.g., Python version and library versions) for compatibility.
- Data and Model Paths: Adjust any paths used in the notebook for loading datasets, images, or models to match your local directory structure.
By following these steps, you should be able to run the soil classification model on your local machine, using your images for classification. Remember, the key to a smooth transition from Colab to a local environment is ensuring that all dependencies are correctly installed and that file paths are appropriately set.