AI Model Types
What are AI Models?
Artificial intelligence models are algorithms trained to recognize patterns in images and make automatic predictions. Rosepetal supports different types of models according to specific visual inspection needs.
Available Model Types
🏷️ Classification (MULTICLASS)
What does it do?
Categorizes complete images into different predefined classes or categories.
Use Cases
- Quality control: "Good" vs "Defective"
- Product categorization: Type A, B, C
- Defect classification: Scratch, dent, stain
- Compliance verification: Pass/Fail
Features
- One label per image: Each image belongs to a single class
- Output with confidence: Percentage of certainty for each prediction
- Multiple classes: Can handle 2 to N different categories
- Fast and efficient: Ideal for binary or multiple decisions
Practical Example
Screw image → Model → "Good" (95% confidence)
Part image → Model → "Defective" (87% confidence)
🚨 Anomaly Detection (ANOMALY)
What does it do?
Identifies anomalous elements or out of the ordinary by comparing with learned patterns from "correct" samples.
Use Cases
- Detection of unknown defects: Without previous examples of the defect
- Surface inspection: Cracks, scratches, deformations
- Uniformity control: Variations in texture or shape
- Contamination detection: Unexpected particles or stains
Features
- Unsupervised learning: Only needs "normal" examples
- Novelty detection: Finds patterns not seen before
- Anomaly score: Degree of "rarity" of each image
- Configurable sensitivity: Adjust detection level
Practical Example
Train with: 1000 images of perfect parts
Predicts: New image → "Anomaly detected" (marked area)
🎯 Object Detection (imageObjectDetection)
What does it do?
Locates and classifies multiple objects within the same image, drawing bounding boxes around each one.
Use Cases
- Automatic counting: Number of parts in a tray
- Component localization: Find screws, chips, connectors
- Assembly inspection: Verify presence and position of parts
- Layout analysis: Distribution of elements on surfaces
Features
- Multiple detections: Several objects per image
- Precise localization: x,y,width,height coordinates of each object
- Simultaneous classification: Type and location in a single prediction
- Confidence per object: Individual certainty for each detection
Practical Example
Circuit image → Model → [
"Resistor" (x:100, y:50, confidence: 92%),
"Capacitor" (x:200, y:80, confidence: 88%),
"Chip" (x:150, y:120, confidence: 95%)
]
🎨 Segmentation (MULTILABEL)
What does it do?
Delimits precise areas pixel by pixel of different elements or regions of interest in the image.
Use Cases
- Area measurement: Exact size of defects or components
- Morphological analysis: Shape, perimeter, area of objects
- Material separation: Different types of surface
- Region mapping: Specific areas for detailed analysis
Features
- Pixel precision: Exact boundary delimitation
- Multiple regions: Different areas in the same image
- Quantitative analysis: Area, shape, distance measurements
- Color masks: Color visualization of each region
Practical Example
Welding image → Model → Mask that marks:
- Green area: Correct welding (1,234 pixels)
- Red area: Porosity defect (89 pixels)
- Blue area: Base metal (5,678 pixels)
Model Architectures
🎓 Supervised
Require labeled data for training
- Classification: Images with class labels
- Detection: Images with bounding boxes
- Segmentation: Images with pixel-to-pixel masks
🔍 Unsupervised
Learn patterns without explicit labels
- Anomaly detection: Only "normal" examples
- Clustering: Automatic grouping by similarity
- Autoencoders: Image reconstruction
🎯 Semi-supervised
Combine labeled and unlabeled data
- Few examples: When there are few labeled images
- Active learning: Model suggests what to label
- Transfer learning: Leverages pre-trained models
Appropriate Model Selection
🎯 According to Objective
For Binary Decisions
- Recommended: MULTICLASS Classification
- Alternative: Anomaly detection (if only "good" examples exist)
To Locate Elements
- Recommended: Object detection
- When: You need to know WHERE the object/defect is
For Precise Measurements
- Recommended: MULTILABEL Segmentation
- When: You need exact area, shape or perimeter
For Unknown Defects
- Recommended: Anomaly detection
- When: You don't have examples of all possible defects
📊 According to Available Data
With Many Labeled Images
- Classification or Object detection
- Recommended minimum: 100-500 images per class
With Few Labeled Images
- Transfer learning with pre-trained models
- Semi-supervised combining with unlabeled images
Only "Normal" Images
- Anomaly detection
- Ideal when it's difficult to obtain defect examples
⚡ According to Speed Requirements
Real Time (< 100ms)
- Classification: Fastest
- Simple detection: With few objects
Batch Processing
- Segmentation: Detailed analysis
- Complex detection: With many objects
Evaluation Metrics
🏷️ For Classification
- Accuracy: Percentage of total hits
- Precision per class: Hits for each category
- Recall: Ability to find positive cases
- F1-Score: Balance between precision and recall
🎯 For Object Detection
- mAP (mean Average Precision): Average precision per class
- IoU (Intersection over Union): Box overlap
- Localization precision: Coordinate accuracy
- Detection rate: Percentage of objects found
🚨 For Anomaly Detection
- AUC-ROC: Area under the ROC curve
- False positive rate: Normals classified as anomalous
- False negative rate: Undetected anomalies
- Optimal threshold: Balance point between error types
🎨 For Segmentation
- Pixel IoU: Pixel-to-pixel overlap
- Dice Coefficient: Similarity between masks
- Edge precision: Accuracy in contours
- Region completeness: Percentage of correctly segmented area
Implementation Considerations
💻 Computational Resources
- GPU recommended: For complex training
- RAM memory: Varies according to image size and model
- Storage: For large datasets and model history
🔄 Model Updates
- Periodic retraining: With new data
- Versioning: Maintain different versions
- A/B Testing: Compare performance between versions
- Rollback: Ability to return to previous version