CoolFace
Modelpublic

aimhkimi74/Bert-Model-living-room

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes7downloads
Model Card

๐Ÿก Fine-Tuned BERT for Interior Design (Living Room)

This is a fine-tuned BERT model for interior design prompt validation and style classification. It was developed as part of my Final Year Project: Text-to-Image Interior Design Generator with Generative AI Assistance.

The model supports:

  • โ€”โœ… Prompt Validation โ€“ distinguish valid vs. invalid design prompts
  • โ€”๐Ÿท๏ธ Style Classification โ€“ classify valid prompts into 7 living room design styles:
  • โ€”Modern
  • โ€”Scandinavian
  • โ€”Rustic
  • โ€”Industrial
  • โ€”Traditional
  • โ€”Mid-Century Modern
  • โ€”Coastal

๐Ÿ“Š Results

  • โ€”Prompt Validation (binary classification) โ†’ F1-score: 1.00
  • โ€”Style Classification (7 classes) โ†’ F1-score: 0.99

๐Ÿ“‚ Model Details

  • โ€”Base model: bert-base-uncased
  • โ€”Library: Transformers (PyTorch)
  • โ€”Trained with: custom dataset of interior design prompts
  • โ€”Labels mapping:
json
  {
    "id2label": {
      "0": "Modern",
      "1": "Scandinavian",
      "2": "Rustic",
      "3": "Industrial",
      "4": "Traditional",
      "5": "Mid-Century Modern",
      "6": "Coastal"
    },
    "label2id": {
      "Modern": 0,
      "Scandinavian": 1,
      "Rustic": 2,
      "Industrial": 3,
      "Traditional": 4,
      "Mid-Century Modern": 5,
      "Coastal": 6
    }
  }

โš™๏ธ How to Use

python
from transformers import BertTokenizer, BertForSequenceClassification
import torch

# Load model from Hugging Face Hub
tokenizer = BertTokenizer.from_pretrained("aimhkimi74/Bert-Model-living-room")
model = BertForSequenceClassification.from_pretrained("aimhkimi74/Bert-Model-living-room")

# Example prompt
text = "A modern living room with a gray sofa and wooden floor."
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
pred = torch.argmax(outputs.logits, dim=1)

# Map prediction to style
label_map = {
    0: "Modern",
    1: "Scandinavian",
    2: "Rustic",
    3: "Industrial",
    4: "Traditional",
    5: "Mid-Century Modern",
    6: "Coastal"
}
print("Predicted Style:", label_map[pred.item()])

๐Ÿ“– Training Procedure

  • โ€”Optimizer: AdamW
  • โ€”Learning Rate: 5e-5
  • โ€”Epochs: 4
  • โ€”Batch size: 32
  • โ€”Evaluation metrics: Accuracy, F1-score

โš ๏ธ Intended Use & Limitations

  • โ€”Intended use: Assist a text-to-image system by validating prompts and tagging living-room styles.
  • โ€”Not intended for: Architectural safety decisions, non-living-room styles, or multilingual inputs (English only).
  • โ€”Known limits: Performance may drop outside the 7 styles or with very short/ambiguous prompts.

๐Ÿ“œ License

This model is released under the MIT License.

๐Ÿ“š References

  • โ€”Devlin, J. et al. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
  • โ€”Hugging Face Transformers library
  • โ€”Rombach, R. et al. High-Resolution Image Synthesis with Latent Diffusion Models