How roar3691/art_image_classifier works
Project type and purpose
• This is a standalone deep‑learning training pipeline for an image‑based defect detector (“Art_image_classifier”).
• It ingests labeled images, preprocesses them, trains two base architectures (MobileNetV3Large and InceptionV3), ensembles their outputs, evaluates performance, and exports the best model.
File structure
• Top‑level files:
– train_model.py: the main training script and orchestrator.
– best_model.keras: the serialized ensemble model ready for inference.
– README.md, LICENSE, .gitignore: metadata/config.
• Absence of a data/ folder implies images are loaded via paths or a data‑pipeline inside train_model.py.
• No separate modules or subdirectories—everything lives in a single script, so the logical components are embedded in code blocks.
Extract insights from the README
• Two backbone networks: MobileNetV3Large and InceptionV3.
• A custom data pipeline handles loading, augmentation, batching, and class‑weighting.
• An ensemble strategy combines the two model outputs to yield a final prediction.
• TensorFlow is the core framework.
Main components
a. Data Source
– Labeled image directories or file manifest (external storage)
b. Data Pipeline
– Image loader
– Preprocessing (resizing, normalization, augmentation)
– Batch generator with class‑weighting logic
c. Model Training Pipelines (parallel)
– MobileNetV3Large branch
– InceptionV3 branch
d. Ensemble Module
– Aggregator that merges predictions from both branches (e.g., weighted average or meta‑learner)
e. Evaluation
– F1‑score calculator, confusion matrix generator, logs
f. Model Export
– Serialization to best_model.keras for deployment/use
g. External Dependencies
– TensorFlow/Keras
– Any logging, metrics, or visualization libraries
Relationships and interactions
• Data flows from the Data Source into the Data Pipeline.
• Preprocessed batches are sent to both MobileNetV3Large and InceptionV3 branches concurrently.
• Each branch produces prediction logits.
• The Ensemble Module takes both sets of logits and outputs final predictions.
• The Evaluation component consumes true labels and final predictions.
• Upon satisfactory metrics, the trained ensemble is exported to best_model.keras.
Important architectural patterns
• Parallelism: two model training branches run in tandem on the same data.
• Modular pipeline: clear separation between data handling, model definition, ensembling, and evaluation.
• Export‑ready artifact: decoupling training logic (train_model.py) from inference artifact (best_model.keras).