C# AI-Based Background Removal App

Job ID: 39958235

Budget: €100 – €350 EUR

AI Background Removal Demo Application - Project Specification

Project Overview
I need a standalone C# demo application that demonstrates AI-powered automatic background removal from images containing people. The application should remove backgrounds from any photo and replace them with a custom background image - no physical greenscreen required.

Application Type
· Standalone Windows desktop application (WPF)
· Target Framework: .NET Framework 4.7.2
· Platform: Windows 10/11 x64

Core Functionality

1. Background Removal Engine
Implement person segmentation that:
· Detects and preserves people in the image
· Detects and preserves objects held by people (phones, bags, props, etc.)
· Works on any background (indoor, outdoor, patterns, solid colors)
· Generates a clean alpha mask separating foreground from background
· Preserves fine details like hair edges

Technology Options (please specify your recommendation – no Cloud API, Project should run without Internet Connection):
· ONNX Runtime with pre-trained models (U2-Net, MODNet, RMBG-1.4, etc.)
· MediaPipe (.NET wrapper if available)
· Other proven solutions you recommend

2. Simple User Interface
The demo app should have:
· Input section:
· Button to load source image (person photo)
· Button to load background image (replacement background)
· Processing section:
· "Remove Background" button
· Progress indicator during processing
· Processing time display
· Output section:
· Preview of original image
· Preview of mask (alpha channel visualization)
· Preview of final result (person + new background)
· Side-by-side comparison view
· Settings panel (adjustable parameters):
· Edge refinement strength (slider 0-100)
· Feathering amount (slider 0-50)
· Confidence threshold (slider 0.0-1.0)
· Processing mode (dropdown: Fast/Balanced/High Quality)
· Export section:
· Save result as PNG (with transparency)
· Save result as JPG (background already applied)
· Batch processing folder selection

3. Image Processing Pipeline

a. Load source image (JPG/PNG)
b. Run AI segmentation → generate alpha mask
c. Apply edge refinement (optional)
d. Apply feathering for smooth edges
e. Load background image
f. Composite: background + foreground with alpha mask
g. Display/save result

4. Performance Requirements
• 1920x1080 image:
• High Quality mode: < 3 seconds
• Fast mode: < 1 second
• 4K image: < 6 seconds (High Quality)
• Memory usage: < 1GB during processing
• CPU-based processing (GPU acceleration optional/bonus)

5. Edge Quality Features
Implement post-processing for natural results:
• Edge feathering (Gaussian blur on mask edges)
• Guided filter or bilateral filter for refinement
• Optional: Green spill removal if source had greenscreen lighting
• Optional: Shadow generation beneath person

Technical Deliverables

1. Source Code StructureBackgroundRemovalDemo/
├── BackgroundRemovalDemo.sln
├── BackgroundRemovalDemo/
│ ├── MainWindow.xaml / Form1.cs
│ ├── App.xaml / Program.cs
│ └── BackgroundRemovalDemo.csproj
├── BackgroundRemovalEngine/
│ ├── IBackgroundRemovalEngine.cs (interface)
│ ├── BackgroundRemovalEngine.cs (implementation)
│ ├── EdgeRefinement.cs
│ ├── ImageCompositor.cs
│ └── BackgroundRemovalEngine.csproj
├── Models/ (if using local AI models)
│ ├── model.onnx
│ └── README.md (model source, license)
├── TestImages/
│ ├── sample_person1.jpg
│ ├── sample_person2.jpg
│ ├── sample_background1.jpg
│ └── sample_background2.jpg
└── README.md

2. Core Interface Example
public interface IBackgroundRemovalEngine
{
// Remove background and return image with alpha channel
Bitmap RemoveBackground(Bitmap sourceImage, BackgroundRemovalSettings settings);

// Get just the alpha mask
Bitmap GenerateMask(Bitmap sourceImage, BackgroundRemovalSettings settings);

// Complete pipeline: remove background and apply new one
Bitmap ReplaceBackground(Bitmap sourceImage, Bitmap newBackground, BackgroundRemovalSettings settings);
}

public class BackgroundRemovalSettings
{
public int EdgeRefinement { get; set; } // 0-100
public int FeatherAmount { get; set; } // 0-50 pixels
public double ConfidenceThreshold { get; set; } // 0.0-1.0
public ProcessingMode Mode { get; set; } // Fast/Balanced/HighQuality
}

public enum ProcessingMode
{
Fast,
Balanced,
HighQuality
}

3. Required NuGet Packages
Please specify which packages you'll use, for example:
· Microsoft.ML.OnnxRuntime (if using ONNX)
· OpenCvSharp4 / OpenCvSharp4.runtime.win
· System.Drawing.Common
· Other dependencies as needed

4. AI Model Requirements (if used)
· Model size: < 200MB
· Input format: RGB image, any resolution
· Output format: Single-channel mask or RGBA image
· License: Must be commercially usable (MIT, Apache 2.0, or similar)
· Include download link or bundle with project
· Document model source and training data

5. Test Scenarios
Provide sample images demonstrating:
· ✅ Single person, plain background
· ✅ Single person, complex background
· ✅ Multiple people
· ✅ Person holding objects (phone, umbrella, sign)
· ✅ Complex hair (curly, long, backlit)
· ✅ Different lighting (bright, dim, mixed)
· ✅ Full body and portrait shots

Documentation Requirements

1. README.md
Include:
· Project overview
· Technology/algorithm used
· Setup instructions
· How to run the demo
· Dependencies and installation
· Model information (if applicable)
· Performance benchmarks on your test machine
· Known limitations

2. Code Documentation
· XML comments on public classes/methods
· Inline comments explaining algorithm steps
· Parameter descriptions and valid ranges

3. Architecture Document
Brief explanation of:
· Why you chose this specific technology/model
· How the segmentation algorithm works
· Edge refinement approach
· Performance optimization techniques
· Alternative approaches considered

Evaluation Criteria

Your solution will be evaluated on:
1. Quality (40%)
· Accurate person detection
· Clean edges, especially hair
· Handles various backgrounds
· Preserves held objects

2. Performance (25%)
· Processing speed
· Memory efficiency
· Meets performance targets

3. Code Quality (20%)
· Clean, maintainable code
· Proper error handling
· Memory management (dispose resources)
· Following C# best practices

4. Usability (15%)
· Intuitive demo UI
· Clear visual feedback
· Easy to test with own images

Budget & Timeline

Timeline: 1-2 weeks
Budget: Please provide:
· Fixed price
· Any additional costs (model licenses – better if not needed)

Bonus Features (Optional)
These are not required but would be impressive:
· Real-time video preview (webcam input)
· Batch processing (process folder of images)
· Automatic parameter tuning based on image analysis
· GPU acceleration option
· Multiple background removal algorithms to compare
· Export settings presets
· Undo/redo functionality

Required Skills
· C# WPF or WinForms development
· Image processing knowledge
· Experience with ML model deployment in .NET
· Computer vision fundamentals
· Performance optimization

Deliverable Format
1. Complete Visual Studio solution (.sln)
2. All source code with comments
3. Pre-trained model files or download instructions
4. Test images (at least 5 diverse examples)
5. README.md with setup and usage instructions
6. Architecture/technical documentation
7. Performance benchmark results
8. License information for all third-party components

---
Note to Applicants:
Please include in your proposal:
1. Technology choice: Which background removal approach you'll use and why
2. Model comparison: If using AI models, compare 2-3 options (accuracy, speed, size, license)
3. Sample work: Links to similar computer vision projects
4. Performance estimate: Expected processing time on mid-range CPU
5. Commercial licensing: Confirm all components can be used commercially
6. Timeline: Realistic delivery date
Priority: A working demo with good quality results that processes images in reasonable time (1-3 seconds per image at 1920x1080).