You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project implements a pixel-wise floor segmentation model using Support Vector Machine (SVM) with rich multi-scale features. The model classifies each pixel in an image as either "floor" or "non-floor".
Final Results
Accuracy: 96.75%
Precision (Floor): 96%
Recall (Floor): 98%
F1-Score: 97%
Dataset
Location:adithya_230145/ folder in Google Drive
Images: 10 floor images in various formats (jpg, jpeg, webp)
Annotations: COCO JSON format polygon masks (coco_annotations.json)
Total Samples: 100,000 pixels (50K floor + 50K non-floor)
Features Extracted (20 per pixel)
Feature
Description
RGB (3)
Red, Green, Blue color values
HSV (3)
Hue, Saturation, Value color space
Grayscale (1)
Intensity value
Multi-scale LBP (3)
Local Binary Pattern at R=1,2,3
Gaussian Blur (2)
Smoothed versions at sigma=2,5
Local Stats (2)
Patch mean and standard deviation
Edge Magnitude (1)
Sobel edge strength
Spatial Position (2)
Normalized x,y coordinates
DoG-like (1)
Difference of Gaussians
Color Ratios (2)
R-B difference, G/R ratio
Model Architecture
Algorithm: Support Vector Machine (SVM)
Kernel: RBF (Radial Basis Function)
Parameters: C=50, gamma=0.1
Scaler: StandardScaler (z-score normalization)
How to Use the Trained Model
importjoblibimportcv2importnumpyasnpfromskimage.featureimportlocal_binary_patternfromscipy.ndimageimportuniform_filter, gaussian_filter# Load model and scalerclf=joblib.load("svm_floor_model_v2.pkl")
scaler=joblib.load("svm_scaler_v2.pkl")
# Extract features from a new imagedefextract_features_for_prediction(image):
# (Same feature extraction as training)# Returns feature array for all pixelspass# Predictfeatures=extract_features_for_prediction(new_image)
features_scaled=scaler.transform(features)
prediction=clf.predict(features_scaled)
mask=prediction.reshape(image_height, image_width)
Files Saved
File
Description
svm_floor_model_v2.pkl
Trained SVM model
svm_scaler_v2.pkl
Feature scaler
Improvement from Baseline
Version
Features
Accuracy
v1 (Basic)
4 features (LBP + RGB)
73.47%
v2 (Improved)
20 features (multi-scale)
96.75%
Improvement: +23.28%
Future Improvements
Use deep learning (SegFormer, DeepLabV3+) for 98-99% IoU
Add more training images (500+)
Use SAM for auto-labeling
Implement CRF post-processing
References
scikit-learn SVM documentation
Local Binary Patterns (LBP) for texture
COCO dataset format
About
Indoor floor segmentation using SVM with multi-scale features (LBP, HSV, edge detection). Achieves 96.75% accuracy on COCO-format annotated dataset.