comparison image_learner.xml @ 15:d17e3a1b8659 draft default tip

planemo upload for repository https://github.com/goeckslab/gleam.git commit bc50fef8acb44aca15d0a1746e6c0c967da5bb17
author goeckslab
date Fri, 28 Nov 2025 15:45:49 +0000
parents 94cd9ac4a9b1
children
comparison
equal deleted inserted replaced
14:94cd9ac4a9b1 15:d17e3a1b8659
1 <tool id="image_learner" name="Image Learner" version="0.1.3" profile="22.05"> 1 <tool id="image_learner" name="Image Learner" version="0.1.4" profile="22.05">
2 <description>trains and evaluates an image classification/regression model</description> 2 <description>trains and evaluates an image classification/regression model</description>
3 <requirements> 3 <requirements>
4 <container type="docker">quay.io/goeckslab/galaxy-ludwig-gpu:0.10.1</container> 4 <container type="docker">quay.io/goeckslab/galaxy-ludwig-gpu:0.10.1</container>
5 </requirements> 5 </requirements>
6 <required_files> 6 <required_files>
27 #if $input_csv 27 #if $input_csv
28 #set $sanitized_input_csv = re.sub('[^\w\-_\.]', '_', $input_csv.element_identifier.strip()) 28 #set $sanitized_input_csv = re.sub('[^\w\-_\.]', '_', $input_csv.element_identifier.strip())
29 ln -sf '$input_csv' "./${sanitized_input_csv}"; 29 ln -sf '$input_csv' "./${sanitized_input_csv}";
30 #end if 30 #end if
31 31
32 #if $task_selection.task == "binary"
33 #set $selected_validation_metric = $task_selection.validation_metric_binary
34 #elif $task_selection.task == "classification"
35 #set $selected_validation_metric = $task_selection.validation_metric_multiclass
36 #elif $task_selection.task == "regression"
37 #set $selected_validation_metric = $task_selection.validation_metric_regression
38 #else
39 #set $selected_validation_metric = None
40 #end if
41
32 python '$__tool_directory__/image_learner_cli.py' 42 python '$__tool_directory__/image_learner_cli.py'
33 --csv-file "./${sanitized_input_csv}" 43 --csv-file "./${sanitized_input_csv}"
34 --image-zip "$image_zip" 44 --image-zip "$image_zip"
35 --model-name "$model_name" 45 --model-name "$model_name"
36 #if $use_pretrained == "true" 46 #if $use_pretrained == "true"
37 --use-pretrained 47 --use-pretrained
38 #if $fine_tune == "true" 48 #if $fine_tune == "true"
39 --fine-tune 49 --fine-tune
40 #end if 50 #end if
41 #end if 51 #end if
42 #if $customize_defaults == "true" 52 #if $advanced_settings.customize_defaults == "true"
43 #if $epochs 53 #if $advanced_settings.epochs
44 --epochs "$epochs" 54 --epochs "$advanced_settings.epochs"
45 #end if 55 #end if
46 #if $early_stop 56 #if $advanced_settings.early_stop
47 --early-stop "$early_stop" 57 --early-stop "$advanced_settings.early_stop"
48 #end if 58 #end if
49 #if $learning_rate_define == "true" 59 #if $advanced_settings.learning_rate_condition.learning_rate_define == "true"
50 --learning-rate "$learning_rate" 60 --learning-rate "$advanced_settings.learning_rate_condition.learning_rate"
51 #end if 61 #end if
52 #if $batch_size_define == "true" 62 #if $advanced_settings.batch_size_condition.batch_size_define == "true"
53 --batch-size "$batch_size" 63 --batch-size "$advanced_settings.batch_size_condition.batch_size"
54 #end if 64 #end if
55 --split-probabilities "$train_split" "$val_split" "$test_split" 65 --split-probabilities "$advanced_settings.train_split" "$advanced_settings.val_split" "$advanced_settings.test_split"
56 #if $threshold 66 #if $advanced_settings.threshold
57 --threshold "$threshold" 67 --threshold "$advanced_settings.threshold"
58 #end if 68 #end if
59 #end if 69 #end if
60 #if $augmentation 70 #if $augmentation
61 --augmentation "$augmentation" 71 --augmentation "$augmentation"
62 #end if 72 #end if
73 #if $selected_validation_metric
74 --validation-metric "$selected_validation_metric"
75 #end if
76 #if $column_override.override_columns == "true"
77 #if $column_override.target_column
78 --target-column "$column_override.target_column"
79 #end if
80 #if $column_override.image_column
81 --image-column "$column_override.image_column"
82 #end if
83 #end if
63 --image-resize "$image_resize" 84 --image-resize "$image_resize"
64 --random-seed "$random_seed" 85 --random-seed "$random_seed"
65 --output-dir "." && 86 --output-dir "." &&
66 87
67 mkdir -p '$output_model.extra_files_path' && 88 mkdir -p '$output_model.extra_files_path' &&
72 </command> 93 </command>
73 94
74 <inputs> 95 <inputs>
75 <param name="input_csv" type="data" format="csv" optional="false" label="the metadata csv containing image_path column, label column and optional split column" /> 96 <param name="input_csv" type="data" format="csv" optional="false" label="the metadata csv containing image_path column, label column and optional split column" />
76 <param name="image_zip" type="data" format="zip" optional="false" label="Image zip" help="Image zip file containing your image data"/> 97 <param name="image_zip" type="data" format="zip" optional="false" label="Image zip" help="Image zip file containing your image data"/>
98 <conditional name="task_selection">
99 <param name="task" type="select" label="Task type" help="Pick task to see only metrics Ludwig accepts for that task; Auto lets the tool infer task and metric.">
100 <option value="auto" selected="true">Auto (infer and use defaults)</option>
101 <option value="binary">Binary Classification</option>
102 <option value="classification">Multi-class Classification</option>
103 <option value="regression">Regression</option>
104 </param>
105 <when value="binary">
106 <param name="validation_metric_binary" type="select" optional="true" label="Validation metric (binary)" help="Metrics accepted by Ludwig for binary outputs.">
107 <option value="roc_auc" selected="true">ROC-AUC</option>
108 <option value="accuracy">Accuracy</option>
109 <option value="balanced_accuracy">Balanced Accuracy</option>
110 <option value="precision">Precision</option>
111 <option value="recall">Recall</option>
112 <option value="f1">F1</option>
113 <option value="specificity">Specificity</option>
114 <option value="log_loss">Log Loss</option>
115 <option value="loss">Loss</option>
116 </param>
117 </when>
118 <when value="classification">
119 <param name="validation_metric_multiclass" type="select" optional="true" label="Validation metric (multi-class)" help="Metrics accepted by Ludwig for multi-class outputs.">
120 <option value="accuracy" selected="true">Accuracy</option>
121 <option value="roc_auc">ROC-AUC</option>
122 <option value="loss">Loss</option>
123 <option value="balanced_accuracy">Balanced Accuracy</option>
124 <option value="precision">Precision</option>
125 <option value="recall">Recall</option>
126 <option value="f1">F1</option>
127 <option value="specificity">Specificity</option>
128 <option value="log_loss">Log Loss</option>
129 </param>
130 </when>
131 <when value="regression">
132 <param name="validation_metric_regression" type="select" optional="true" label="Validation metric (regression)" help="Metrics accepted by Ludwig for regression outputs.">
133 <option value="pearson_r" selected="true">Pearson r</option>
134 <option value="mae">MAE</option>
135 <option value="mse">MSE</option>
136 <option value="rmse">RMSE</option>
137 <option value="mape">MAPE</option>
138 <option value="r2">R²</option>
139 <option value="explained_variance">Explained Variance</option>
140 <option value="loss">Loss</option>
141 </param>
142 </when>
143 <when value="auto">
144 <!-- No validation metric selection; tool will infer task and metric. -->
145 </when>
146 </conditional>
147 <conditional name="column_override">
148 <param name="override_columns" type="select" label="Overwrite label and/or image column names?" help="Select yes to specify custom column names instead of the defaults 'label' and 'image_path'.">
149 <option value="false" selected="true">No</option>
150 <option value="true">Yes</option>
151 </param>
152 <when value="true">
153 <param name="target_column" type="text" optional="true" label="Target/label column name" help="Overrides the default 'label' column name in the metadata CSV." />
154 <param name="image_column" type="text" optional="true" label="Image column name" help="Overrides the default 'image_path' column name in the metadata CSV." />
155 </when>
156 <when value="false">
157 <!-- No additional parameters -->
158 </when>
159 </conditional>
77 <param name="model_name" type="select" optional="false" label="Select a model for your experiment" > 160 <param name="model_name" type="select" optional="false" label="Select a model for your experiment" >
78 161
79 <option value="resnet18">Resnet18</option> 162 <option value="resnet18">Resnet18</option>
80 <option value="resnet34">Resnet34</option> 163 <option value="resnet34">Resnet34</option>
81 <option value="resnet50">Resnet50</option> 164 <option value="resnet50">Resnet50</option>
323 <test expect_num_outputs="3"> 406 <test expect_num_outputs="3">
324 <param name="input_csv" value="mnist_subset.csv" ftype="csv" /> 407 <param name="input_csv" value="mnist_subset.csv" ftype="csv" />
325 <param name="image_zip" value="mnist_subset.zip" ftype="zip" /> 408 <param name="image_zip" value="mnist_subset.zip" ftype="zip" />
326 <param name="model_name" value="resnet18" /> 409 <param name="model_name" value="resnet18" />
327 <param name="augmentation" value="random_horizontal_flip,random_vertical_flip,random_rotate" /> 410 <param name="augmentation" value="random_horizontal_flip,random_vertical_flip,random_rotate" />
328 <output name="output_report"> 411 <param name="task_selection|task" value="classification" />
329 <assert_contents> 412 <param name="task_selection|validation_metric_multiclass" value="accuracy" />
330 <has_text text="Results Summary" /> 413 <output name="output_report">
331 <has_text text="Train/Validation Results" /> 414 <assert_contents>
415 <has_text text="Config and Overall Performance Summary" />
416 <has_text text="Training and Validation Results" />
332 <has_text text="Test Results" /> 417 <has_text text="Test Results" />
333 </assert_contents> 418 </assert_contents>
334 </output> 419 </output>
335 420
336 <output_collection name="output_pred_csv" type="list" > 421 <output_collection name="output_pred_csv" type="list" >
345 <param name="input_csv" value="utkface_labels.csv" ftype="csv" /> 430 <param name="input_csv" value="utkface_labels.csv" ftype="csv" />
346 <param name="image_zip" value="age_regression.zip" ftype="zip" /> 431 <param name="image_zip" value="age_regression.zip" ftype="zip" />
347 <param name="model_name" value="resnet18" /> 432 <param name="model_name" value="resnet18" />
348 <output name="output_report"> 433 <output name="output_report">
349 <assert_contents> 434 <assert_contents>
350 <has_text text="Results Summary" /> 435 <has_text text="Config and Overall Performance Summary" />
351 <has_text text="Train/Validation Results" /> 436 <has_text text="Training and Validation Results" />
352 <has_text text="Test Results" /> 437 <has_text text="Test Results" />
353 </assert_contents> 438 </assert_contents>
354 </output> 439 </output>
355 <output_collection name="output_pred_csv" type="list" > 440 <output_collection name="output_pred_csv" type="list" >
356 <element name="predictions.csv" > 441 <element name="predictions.csv" >
364 <param name="input_csv" value="mnist_subset.csv" ftype="csv" /> 449 <param name="input_csv" value="mnist_subset.csv" ftype="csv" />
365 <param name="image_zip" value="mnist_subset.zip" ftype="zip" /> 450 <param name="image_zip" value="mnist_subset.zip" ftype="zip" />
366 <param name="model_name" value="caformer_s18" /> 451 <param name="model_name" value="caformer_s18" />
367 <output name="output_report"> 452 <output name="output_report">
368 <assert_contents> 453 <assert_contents>
369 <has_text text="Results Summary" /> 454 <has_text text="Config and Overall Performance Summary" />
370 <has_text text="Train/Validation Results" /> 455 <has_text text="Training and Validation Results" />
371 <has_text text="Test Results" /> 456 <has_text text="Test Results" />
372 </assert_contents> 457 </assert_contents>
373 </output> 458 </output>
374 459
375 <output_collection name="output_pred_csv" type="list" > 460 <output_collection name="output_pred_csv" type="list" >
386 <param name="model_name" value="randformer_s12" /> 471 <param name="model_name" value="randformer_s12" />
387 <param name="advanced_settings|customize_defaults" value="true" /> 472 <param name="advanced_settings|customize_defaults" value="true" />
388 <param name="advanced_settings|epochs" value="5" /> 473 <param name="advanced_settings|epochs" value="5" />
389 <output name="output_report"> 474 <output name="output_report">
390 <assert_contents> 475 <assert_contents>
391 <has_text text="Results Summary" /> 476 <has_text text="Test Performance Summary" />
392 <has_text text="Train/Validation Results" /> 477 <has_text text="Training and Validation Results" />
393 <has_text text="Test Results" /> 478 <has_text text="Test Results" />
394 </assert_contents> 479 </assert_contents>
395 </output> 480 </output>
396 481
397 <output_collection name="output_pred_csv" type="list" > 482 <output_collection name="output_pred_csv" type="list" >
408 <param name="image_zip" value="mnist_subset.zip" ftype="zip" /> 493 <param name="image_zip" value="mnist_subset.zip" ftype="zip" />
409 <param name="model_name" value="caformer_s18_384" /> 494 <param name="model_name" value="caformer_s18_384" />
410 <param name="image_resize" value="384x384" /> 495 <param name="image_resize" value="384x384" />
411 <output name="output_report"> 496 <output name="output_report">
412 <assert_contents> 497 <assert_contents>
413 <has_text text="Results Summary" /> 498 <has_text text="Config and Overall Performance Summary" />
414 <has_text text="Train/Validation Results" /> 499 <has_text text="Training and Validation Results" />
415 <has_text text="Test Results" /> 500 <has_text text="Test Results" />
416 </assert_contents> 501 </assert_contents>
417 </output> 502 </output>
418 <output_collection name="output_pred_csv" type="list" > 503 <output_collection name="output_pred_csv" type="list" >
419 <element name="predictions.csv" > 504 <element name="predictions.csv" >
431 <!-- Test 8: Binary classification with custom threshold - verifies ROC curve generation for binary tasks; need to find a test dataset --> 516 <!-- Test 8: Binary classification with custom threshold - verifies ROC curve generation for binary tasks; need to find a test dataset -->
432 <!-- <test expect_num_outputs="3"> 517 <!-- <test expect_num_outputs="3">
433 <param name="input_csv" value="binary_classification.csv" ftype="csv" /> 518 <param name="input_csv" value="binary_classification.csv" ftype="csv" />
434 <param name="image_zip" value="binary_images.zip" ftype="zip" /> 519 <param name="image_zip" value="binary_images.zip" ftype="zip" />
435 <param name="model_name" value="resnet18" /> 520 <param name="model_name" value="resnet18" />
436 <param name="customize_defaults" value="true" /> 521 <param name="advanced_settings|customize_defaults" value="true" />
437 <param name="threshold" value="0.6" /> 522 <param name="advanced_settings|threshold" value="0.6" />
438 <output name="output_report"> 523 <output name="output_report">
439 <assert_contents> 524 <assert_contents>
440 <has_text text="Results Summary" /> 525 <has_text text="Results Summary" />
441 <has_text text="Train/Validation Results" /> 526 <has_text text="Train/Validation Results" />
442 <has_text text="Test Results" /> 527 <has_text text="Test Results" />
460 <!-- Test 10: Multi-class classification with ROC curves - verifies robust ROC-AUC plot generation --> 545 <!-- Test 10: Multi-class classification with ROC curves - verifies robust ROC-AUC plot generation -->
461 <!-- <test expect_num_outputs="3"> 546 <!-- <test expect_num_outputs="3">
462 <param name="input_csv" value="mnist_subset.csv" ftype="csv" /> 547 <param name="input_csv" value="mnist_subset.csv" ftype="csv" />
463 <param name="image_zip" value="mnist_subset.zip" ftype="zip" /> 548 <param name="image_zip" value="mnist_subset.zip" ftype="zip" />
464 <param name="model_name" value="resnet18" /> 549 <param name="model_name" value="resnet18" />
465 <param name="customize_defaults" value="true" /> 550 <param name="advanced_settings|customize_defaults" value="true" />
466 <param name="epochs" value="3" /> 551 <param name="advanced_settings|epochs" value="3" />
467 <output name="output_report"> 552 <output name="output_report">
468 <assert_contents> 553 <assert_contents>
469 <has_text text="Results Summary" /> 554 <has_text text="Results Summary" />
470 <has_text text="Train/Validation Results" /> 555 <has_text text="Train/Validation Results" />
471 <has_text text="Test Results" /> 556 <has_text text="Test Results" />
485 <param name="input_csv" value="mnist_subset_binary.csv" ftype="csv" /> 570 <param name="input_csv" value="mnist_subset_binary.csv" ftype="csv" />
486 <param name="image_zip" value="mnist_subset.zip" ftype="zip" /> 571 <param name="image_zip" value="mnist_subset.zip" ftype="zip" />
487 <param name="model_name" value="resnet18" /> 572 <param name="model_name" value="resnet18" />
488 <param name="advanced_settings|customize_defaults" value="true" /> 573 <param name="advanced_settings|customize_defaults" value="true" />
489 <param name="advanced_settings|threshold" value="0.6" /> 574 <param name="advanced_settings|threshold" value="0.6" />
490 <output name="output_report"> 575 <param name="task_selection|task" value="classification" />
491 <assert_contents> 576 <param name="task_selection|validation_metric_multiclass" value="balanced_accuracy" />
492 <has_text text="Accuracy" /> 577 <output name="output_report">
493 <has_text text="Precision" /> 578 <assert_contents>
494 <has_text text="Learning Curves Label Accuracy" /> 579 <has_text text="Config and Overall Performance Summary" />
580 <has_text text="Training and Validation Results" />
581 <has_text text="Test Results" />
582 <has_text text="Threshold" />
583 <has_text text="0.60" />
495 </assert_contents> 584 </assert_contents>
496 </output> 585 </output>
497 <output_collection name="output_pred_csv" type="list" > 586 <output_collection name="output_pred_csv" type="list" >
498 <element name="predictions.csv" > 587 <element name="predictions.csv" >
499 <assert_contents> 588 <assert_contents>