Sellestia — background removal that keeps the plate

Sellestia is a BiRefNet-based background-removal model, fine-tuned from Lucida for top-down food photography.

General-purpose models treat the plate as background: they cut the food out and drop the plate, or leave a half-transparent ghost of it. Sellestia keeps the dish and its plate as one subject, whatever the plate's colour, and behaves like Lucida on everything else.

Original | BiRefNet | Lucida | Sellestia

All images above are held out: none of them was used for training.

Results

Held-out test set of top-down dish photos (plate kept = correct answer), the test split of the Sellestia dataset:

Model IoU ↑ MAE ↓ Images with IoU ≥ 0.95
BiRefNet 0.555 0.248 2%
Lucida 0.786 0.129 31%
Sellestia 0.992 0.0055 100%

23× lower error than Lucida on food photos, and every test image above 0.95 IoU (worst case 0.965).

Outside food, Sellestia stays close to its base model: on held-out objects, animals and illustrations its masks agree with Lucida's at 0.987 IoU.

Usage

import torch
from PIL import Image
from torchvision import transforms
from transformers import AutoModelForImageSegmentation

model = AutoModelForImageSegmentation.from_pretrained(
    "franckdsf/sellestia", trust_remote_code=True, dtype=torch.float32)
model.eval()

t = transforms.Compose([
    transforms.Resize((1024, 1024)),
    transforms.ToTensor(),
    transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]),
])
img = Image.open("dish.jpg").convert("RGB")
with torch.no_grad():
    preds = model(t(img).unsqueeze(0))[-1].sigmoid()
alpha = transforms.functional.resize(preds[0], img.size[::-1]).squeeze(0)
rgba = img.copy()
rgba.putalpha(Image.fromarray((alpha.numpy() * 255).astype("uint8")))
rgba.save("dish.png")

Same architecture, preprocessing and 1024×1024 input as Lucida: it is a drop-in replacement anywhere Lucida or BiRefNet is loaded through transformers.

Training

  • Starts from Lucida's weights. The backbone is frozen and only the decoder is fine-tuned, which keeps the base model's general knowledge intact.
  • Data: top-down dish photos with plate-inclusive masks (Sellestia dataset, CC-BY 4.0), mixed with a rehearsal set of varied non-food images (objects, vehicles, animals, glass, people, anime) labelled by Lucida itself, so the model learns "keep the plate" without forgetting the rest.
  • Loss: BCE + IoU. Held-out validation and test splits per data source.

Base model & attribution

  • Fine-tuned from egeorcun/lucida (MIT), itself a fine-tune of ZhengPeng7/BiRefNet_HR (MIT). The original copyright notices are preserved in LICENSE.
  • The rehearsal set includes images from DIS5K, AIM-500, P3M-10K and anime-segmentation (CC0). Some of these are distributed for research purposes; evaluate suitability for your use case.

License

MIT (weights and code).

Downloads last month
-
Safetensors
Model size
0.2B params
Tensor type
I64
·
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for franckdsf/sellestia

Finetuned
egeorcun/lucida
Finetuned
(3)
this model

Dataset used to train franckdsf/sellestia