Semantic segmentation ===================== .. automodule:: remote_sensing_processor.segmentation :members: generate_tiles, train, test, generate_map :show-inheritance: List of available NN models --------------------------- +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | Model | Backbone | Classification | Regression | No metrics-related freeze issues | No convergence issues | Fine-tuning available | Reference | +=================+====================+================+============+===================================+========================+========================+===================================================================================================================================================+ | BEiT | | \+ | \-[4]_ | \+ | \+ | \+ | `Huggingface Transformers `_ | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | ConditionalDETR | | \+ | \+ | \+-[1]_ | \+ | Not tested | `Huggingface Transformers `_ | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | Data2Vec | | \+ | -[4]_ | \+ | \+ | \+ | `Huggingface Transformers `_ | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | DETR | | \+ | \+ | \+-[1]_ | \+ | \+ | `Huggingface Transformers `_ | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | DPT | | \+ | \-[4]_ | \+ | \+ | \+ | `Huggingface Transformers `_ | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | Mask2Former | | \+ | \-[4]_ | \+-[1]_ | \+-[2]_ | \+ | `Huggingface Transformers `_ | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | MaskFormer | | \+ | \-[4]_ | \+ | \+-[2]_ | \ | `Huggingface Transformers `_ | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | MobileNetV2 | | \+ | \+ | \+ | \+ | \+ | `Huggingface Transformers `_ | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | MobileViT | | \+ | \+ | \+ | \+ | \+ | `Huggingface Transformers `_ | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | MobileViTV2 | | \+ | \+ | \+ | \+ | \+ | `Huggingface Transformers `_ | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | OneFormer | Swin | \+ | \-[4]_ | \+-[1]_ | \+-[2]_ | \+ | `Huggingface Transformers `_ | + +--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+ + | | ConvNeXT | \+ | \-[4]_ | \+-[1]_ | \+-[2]_ | Not tested | | + +--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+ + | | ConvNeXTV2 | \+ | \-[4]_ | \+-[1]_ | \+-[2]_ | Not tested | | + +--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+ + | | DiNAT | \-[3]_ | \-[3]_ | | | | | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | SegFormer | | \+ | \-[4]_ | \+ | \+ | \+ | `Huggingface Transformers `_ | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | UperNet | Swin | \+ | \-[4]_ | \+ | \+ | \+ | `Huggingface Transformers `_ | + +--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+ + | | ResNet | \+ | \+ | \+ | \+ | Not tested | | + +--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+ + | | ConvNeXT | \+ | \+ | \+ | \+ | \+ | | + +--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+ + | | ConvNeXTV2 | \+ | \+ | \+ | \+ | Not tested | | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | DeepLabV3 | MobileNet_V3_Large | \+ | \+ | \+ | \+ | \+ | `Torchvision `_ | + +--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | | ResNet50 | \+ | \+ | \+ | \+ | \+ | `Torchvision `_ | + +--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | | ResNet101 | \+ | \+ | \+ | \+ | \+ | `Torchvision `_ | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | FCN | ResNet50 | \+ | \+ | \+ | \+ | \+ | `Torchvision `_ | + +--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | | ResNet101 | \+ | \+ | \+ | \+ | \+ | `Torchvision `_ | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | LRASPP | | \+ | \+ | \+ | \+ | \+ | `Torchvision `_ | +-----------------+--------------------+----------------+------------+-----------------------------------+------------------------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ You can fine-tune pre-trained model by defining ``weights``. For models from Transformers you can get available weights from `Huggingface Hub `_, for Torchvision models you just set ``weights = True``. ``rsp.segmentation.train`` also saves CSV and Tensorboard logs in directory where checkpoint file is saved. List of available Scikit-learn models ------------------------------------- +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | Model | Kernel/solver [5]_ | Classification | Regression | Warm start | Reference | +=======================+====================+================+============+============+=============================================================================================================================================+ | Nearest Neighbors | | \+ | \+ | \- | `Scikit-learn `_ | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | Logistic Regression | lbfgs | \+ | \- | \+ | `Scikit-learn `_ | + +--------------------+----------------+------------+------------+ + | | liblinear | \+ | \- | \- | | + +--------------------+----------------+------------+------------+ + | | newton-cg | \+ | \- | \+ | | + +--------------------+----------------+------------+------------+ + | | newton-cholesky | \+ | \- | \+ | | + +--------------------+----------------+------------+------------+ + | | sag | \+ | \- | \+ | | + +--------------------+----------------+------------+------------+ + | | saga | \+ | \- | \+ | | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | Ridge | | \- | \+ | \- | `Scikit-learn `_ | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | Lasso | | \- | \+ | \- | `Scikit-learn `_ | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | ElasticNet | | \- | \+ | \- | `Scikit-learn `_ | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | SVM | rbf | \+ | \+ | \- | `Scikit-learn `_ | + +--------------------+----------------+------------+------------+ + | | linear | \+ | \+ | \- | | + +--------------------+----------------+------------+------------+ + | | poly | \+ | \+ | \- | | + +--------------------+----------------+------------+------------+ + | | sigmoid | \+ | \+ | \- | | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | Gaussian Process | | \+ | \+ | \+ | `Scikit-learn `_ | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | Naive Bayes | | \+ | \- | \- | `Scikit-learn `_ | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | QDA | | \+ | \- | \- | `Scikit-learn `_ | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | Decision Tree | | \+ | \+ | \- | `Scikit-learn `_ | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | Random Forest | | \+ | \+ | \+ | `Scikit-learn `_ | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | AdaBoost | | \+ | \+ | \- | `Scikit-learn `_ | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | Gradient Boosting | | \+ | \+ | \+ | `Scikit-learn `_ | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | Multilayer Perceptron | | \+ | \+ | \+ | `Scikit-learn `_ | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | XGBoost | | \+ | \+ | \- | `XGBoost `_ | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | XGBoost Random Forest | | \+ | \+ | \- | `XGBoost `_ | +-----------------------+--------------------+----------------+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------+ Models that support warm start can be fine-tuned using pre-trained models with ``checkpoint`` argument. Some models can have issues while saving, especially when trained on big datasets. Some models (like SVM) can train for a very long time or (like Gaussian process) can have memory issues with big datasets. So we recommend using Scikit-learn models only for small datasets. .. [1] These models can freeze forever on one of first steps. It happens due to some confusion matrix-based metrics related error. Try to restart training with ``less_metrics = True``. .. [2] These models showed very poor performance on tests. They only converged slowly with ``lr=1e-5``, but much more slow than other models. I do not recommend using them. .. [3] DiNAT requires ``natten`` library, that is not available on Windows and Mac and not available via Conda. RSP supports DiNAT backbone, but you need to install ``natten`` in your python env manually. .. [4] Loss becomes ``nan`` while training several transformers if the task is regression. .. [5] Is defined with ``backbone`` argument.