Machine Learning in Image Processing

Step-by-step instructions for the project


0. Download a project template; do not change the template structure.

1. Choose one of the following topics:

  •   Single-class Detection (project code: DET)
  •   Multi-class Classification (project code: CLA)
  •   Multi-class Semantic Segmentation (project code: SEG)
  •   Colorization (project code: COL)

2. Download the dataset for the chosen topic and the project template:

3. Prepare a dataset class (dataset.py) and data loaders: 

  •  Create a custom class that subclasses torch.utils.data.Dataset. 
  •  Use only the provided dataset for training
  •  Perform data preprocessing/augmentation if needed, but do not recolor the images
  • You may use DataLoader classes for your work or even create your own, but remember that every file (training.py and inference.py) should be runnable without additional parameters.  

3. Prepare the model class (network.py) and training and inference functions (training.py and inference.py files):

  •    You can create as many additional functions as needed but do not add extra files.

4. Make sure that during the training (in training.py), the required files are generated: 

  • The training and validation losses should be saved and then used to plot learning_curves.png (it must contain train and validation losses; see an example in the template). In the case of GANs and similar architectures, the same image can contain multiple curves, but they should be clearly labelled in the legend.

  • The model architecture should be saved to model_architecture.png. (The provided example also provides a file called "model_architecture" with no extension. This is a plaintext ".dot" file, and it may be deleted once the figure is generated.)

  • The trained model should be saved to the model.pt file. In the case of composite or cascaded models, every submodule should be wrapped in a single module. For GANs, it is not necessary to save the discriminator network, the generator is enough, but the model should be reproducible.

5. The inference.py script should use the model (defined by a path) and a dataset (defined by a path) to perform predictions and save them to the output_predictions folder.

6. When the final model is trained, rename and move to the final_files folder the following files:

  •  model.pt -> final_files/final_model.pt
  •  learning_curve.png -> final_files/final_learning_curve.png
  •  model_architecture.png -> final_files/final_model_architecture.png

7. Add a short description of your project by answering the questions in README.txt

8. Make sure to add UCO at the top of all files with code (there is a placeholder for this: # STUDENT's UCO: 000000)

9. Rename the main template folder (PROJCODE_UCO) by substituting PROJCODE with the project code and UČO - with your UČO.

  • Do not include any of the input images or the model outputs in this archive. Predictions on the public datasets will not be used, and therefore should be excluded. The final archive should be no larger than a few MB.  
  • After renaming, archive the template to PROJCODE_UCO.zip 

10. Submit PROJCODE_UCO.zip to the homework vault:

Students can use evaluation.py to compute an evaluation score for their results. It is not required to submit this file (as a student does not change it).