aimhkimi74/Bert-Model-living-room
07
๐ก 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:
{
"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
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
