Skip to content

About

GUI-first transfer learning studio for image classification, with custom model generation, PEFT fine-tuning strategies, experiment tracking, robustness evaluation, Grad-CAM inspection, and report-ready visual comparison.

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

ModelCraft Studio

A PySide6 desktop workbench for image classification: import labeled datasets, configure CNN and Transformer models, train, inspect checkpoints, and compare predictions and run logs. Originally built for Food-101, the application now uses manually imported datasets.

The screenshots below show the actual Workbench Preview, using local Caltech-101 data and saved experiment artifacts.

Custom Models workbench

Quick start

Run from the repository root using your intended Python environment:

python -m pip install -r requirements.txt
python scripts/app/training_gui_workbench.py

On Windows, double-click launch_workbench.pyw to launch without a console. Its Python association may differ from your terminal. Check the terminal environment with:

python -c "import sys, torch; print(sys.executable); print(torch.__version__); print(torch.version.cuda); print(torch.cuda.is_available())"

Training defaults to CUDA. Use a CUDA-enabled PyTorch installation and compatible GPU, or explicitly select CPU. Workbench reports the training interpreter and CUDA runtime, and blocks unavailable CUDA or silent Auto-to-CPU fallbacks. Set MODELCRAFT_TRAINING_PYTHON to explicitly choose the training interpreter.

The original GUI remains available through python scripts/app/training_gui.py. Workbench has separate window preferences but shares datasets, specifications, generated models, and pipeline code. See Workbench notes.

1. Data: import and preview

Import a labeled folder or CSV/JSON manifest, then click Check Data. Browse train/val/test by class, preview images, and inspect class counts, warnings, and dataset fingerprint. Data is the first tab; the Workbench preview initially opens Custom Models.

Data browser with Caltech-101

Supported inputs include ImageFolder, CSV/JSON manifests, and explicitly imported legacy Food-101 layouts. No dataset is automatically downloaded or selected.

my_dataset/
  train/class_a/*.jpg
  train/class_b/*.jpg
  val/class_a/*.jpg
  val/class_b/*.jpg
  test/class_a/*.jpg
  test/class_b/*.jpg

Class-only folders are also supported; missing splits are created deterministically, stratified by label. Manifests use path, label, and optional split:

path,label,split
images/001.jpg,class_a,train
images/002.jpg,class_b,test

Training inherits the checked dataset without a separate editable data path. GUI checkpoints live under checkpoints/_datasets/<fingerprint>/. Predicting and Logs filter artifacts by the active dataset fingerprint.

Validation behavior

Use Validation Split Existing validation Behavior
Enabled Present Use existing validation; ignore the proportion
Enabled Absent Split validation from train using the proportion and seed
Disabled Either Evaluate on test each epoch; validation is unused

Enable validation for model selection. Best checkpoint selection then uses validation accuracy, followed by test evaluation after training. The GUI currently still allows editing the proportion when validation already exists. Final test evaluates the model at the end of training without automatically reloading best.

Sample datasets

python scripts/maintenance/prepare_sample_datasets.py --datasets caltech101

Import data/sample_datasets/caltech101. This export contains 101 classes and 8,677 images (approximately 214 MB): 6,026 train, 1,256 validation, and 1,395 test, with seed 42. The script also supports mnist, fashion_mnist, kmnist, and cifar10. Datasets, download caches, and trained checkpoints are local artifacts, not included in a fresh clone.

2. Training

Select a model, device, epochs, batch size, image size, optimizer, and learning rate. Advanced settings include augmentation, AMP, gradient accumulation, clipping, resume, and ViT layer-wise learning-rate decay. Generated-model freeze settings come from their specifications. Classification heads adapt to the dataset class count.

Training configuration

The run monitor shows progress and logs. Best/last checkpoints preserve class mappings, dataset metadata, and configuration. JSON logs record metrics, data waiting, compute time, throughput, and peak CUDA memory. Commands can be previewed/exported, and jobs can be queued.

CLI example with validation enabled:

python scripts/entry/training.py --model efficientnet_baseline --data-root data/sample_datasets/caltech101 --dataset-format auto --use-validation-split --epochs 3 --batch-size 32 --num-workers 4 --image-size 224 --device cuda --amp

CLI output directories are independent of the GUI dataset-scoped default. For automatic GUI discovery, set --checkpoint-dir to a model subdirectory under the active dataset's checkpoint root shown in Training.

3. Predicting

Refresh checkpoints after training, select best/last weights, and browse the active dataset's test or validation images. External images can also be selected. Model Comparison supports multiple checkpoints on the same images. CNN Grad-CAM is available where supported; Transformer attention visualization is not implemented.

Saved checkpoint prediction on Caltech-101

4. Test Splits

Evaluate checkpoints on separately prepared robustness datasets, such as blur or downsampling variants. Select a checkpoint and split root, then configure evaluation. This is distinct from the ordinary train/val/test division. The screenshot shows configuration, not completed robustness results.

Test Splits configuration

5. Logs and comparisons

After opening a dataset, refresh Logs to see its runs. Add runs to the comparison selection to view accuracy/loss curves and available analysis, including confusion matrices and efficiency comparisons. Run details include configuration, completion status, and dataset information.

Dataset-scoped run logs

A local Caltech-101 smoke test exercised training, checkpoint saving, logs, and checkpoint-based prediction. It exposed and fixed an evaluation-call bug involving gradient accumulation/clipping arguments. Two CUDA/AMP runs at 224 pixels and batch size 64 completed:

Run (1 epoch) Trainable parameters Test accuracy Training time
EfficientNet baseline 129,381 84.87% 25.00 s
ViT classification-head LoRA 6,952 24.30% 28.63 s

These demonstrate workflow execution rather than a controlled architecture benchmark: the trainable heads differ, neither run reached convergence, and validation was disabled for these smoke runs. Use validation and matched tuning protocols for subsequent comparisons.

6. Custom Models

The three-column workspace is Methods & Tools | Model Architecture | Stage Inspector. Select a base model and pretrained setting, choose a global mode or edit stages, configure supported methods and learning rates, then save/generate. The specification panel exposes editable JSON.

Analyze estimates parameters, FP32 size, shapes, and partial Conv2d/Linear FLOPs. It does not benchmark training or count every operation.

Family Supported bases
CNN efficientnet_v2_s, resnet18, resnet50, convnext_tiny, mobilenet_v3_large, densenet121
Transformer vit_b_16, swin_t
Hybrid CNN/Transformer maxvit_t

CNN methods vary by architecture: baseline, normalization tuning, full fine-tuning, LoRA, DoRA, TSA, Adapter, BitFit, and SSF. Operations are restricted by architecture/stage.

ViT, Swin, and MaxViT support Linear Probe, Norm Tuning, Full Finetune, and selected-stage LoRA. LoRA offers MLP, QKV, QKV + Attention Output, or All Projections, with rank/alpha controls. ViT/Swin attention uses weight parametrization where required by torchvision. MaxViT LoRA targets attention and Transformer MLP, leaving MBConv outside LoRA targeting. Norm Tuning covers normalization modules, including BatchNorm in hybrid models.

Independent learning rates are unavailable on synthetic sub-stage groups. DeiT, timm providers, and Transformer attention visualization are not yet supported.

Queue

The global Queue panel runs training, prediction, and test-split jobs sequentially, with pending-job management and stop controls.

Repository layout

launch_workbench.pyw          Workbench launcher
dataset/                     Dataset detection, splitting, and loading
data/                        Local datasets and download caches
model/                       Legacy and generated models
model_specs/                 JSON model specifications
checkpoints/                 Weights and logs; GUI uses _datasets/<fingerprint>/
scripts/app/                 PySide6 GUI and Workbench presentation
scripts/core/                Model registry, generator, runtime helpers
scripts/entry/               CLI entry points
scripts/pipeline/            Training, prediction, evaluation
scripts/maintenance/         Dataset preparation, checks, screenshots
workflow/                    Workflow utilities
pics/workbench/              Current README screenshots

Developer checks and screenshots

$env:QT_QPA_PLATFORM = 'offscreen'
python scripts/maintenance/check_workbench.py
python scripts/maintenance/check_custom_model_matrix.py
python scripts/maintenance/capture_readme.py

The matrix checks supported model/method configurations and selected GUI-to-spec cases. It does not exhaust all numerical combinations or replace real training tests.

Screenshot capture renders actual Qt widgets and requires local Caltech-101 data. Saved prediction/run artifacts populate their pages when available. Previous demo images are retained for reference; this README uses new Workbench captures.

About

GUI-first transfer learning studio for image classification, with custom model generation, PEFT fine-tuning strategies, experiment tracking, robustness evaluation, Grad-CAM inspection, and report-ready visual comparison.

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages