Implementation of a simple multi-task learner with 3 tasks (heads). Shares internal representation between different tasks (hard parameter sharing, see [2]) having the direct benefit of a lighter, faster model with less trainable parameters.
This implementation has ~192 k trainable parameters, compared to ~290 k used for the same tasks with a multi-headed implementation on separate branches, see [3]. Compared to [3] training samples and epochs are significantly increased, after 2k cycles position accuracy is ~84% while color and shape ~99%.
- Create toy database, generate shapes, color it
- Normalize the generated images / output values (for the regression head)
- Create the multi-task learner Keras functional model, train and test it
- Generate the metrics:
- mean_absolute_error - regression head
- confusion matrix, f1-score for classification heads
- (optional) Freeze the feature detetor part, finetune the regression head
- reivew the metrics
- Regression head (position)
1.1. Regression head (position), after fine-tuning:
2. Color prediction head Confusion Matrix 3. Shape type prediction head Confusion Matrix- keras
- An Overview of Multi-Task Learning in Deep Neural Networks, arXiv:1706.05098 [cs.LG]
- Multi headed DNN predictor, detects object coordinates, color and shape type
/Enjoy.