Skip to content

Handover & Delivery

davidflocondezo edited this page Oct 22, 2025 · 34 revisions

1. Purpose

This handover document provides all materials, insights, and guidance necessary for clients and incoming teams to continue development, testing, and application of the In Situ Root Image Segmentation project.


2. Handover Package Contents

2.1 Client Notes

  • Overview of project objectives, scope, and key milestones achieved.
  • Summary of communications, client feedback, and major decisions.
  • Links to datasets, trained models, and documentation repositories.

2.2 Key Information for New Team Members

  • Summary of current progress and remaining tasks.
  • Known technical dependencies and environment setup details.
  • Key contacts and roles (e.g., client liaison, lead researcher, technical advisor).
  • Access instructions for repositories, servers, and cloud resources.

2.3 Project SECRETS

  • Secure credentials, API keys, or environment variables required for operation.
  • Storage locations for sensitive or restricted data.
  • Versioning notes and configuration details for reproducibility.

3. User Guides

3.1 Labeling Tools

SegMATE

Overview, labeling workflow, and important notes.

  1. Drawing a Box
  • Hold Ctrl
  • Drag the mouse and release
  • (Optional) Hold Shift to add multiple boxes
  1. Clicking a Point
  • Hold Ctrl
  • Left-click for positive points
  • Right-click for negative points
  • (Optional) Hold Shift to add multiple points
  1. Drawing Multiple Boxes in a Region of Interest Automatically
  • Hold Alt
  • Drag the mouse to draw a loop enclosing the region of interest
  • Release the mouse
  1. Important Notes
  • Always switch on “split” mode for root segmentation.
    • To check if you are in split mode, press Ctrl + Space (this also toggles the prompt type between point and box).
  • Always export both the prompts and the mask when you finish.
    • The prompt file is essential if you want to modify the segmentation later.

Photoshop

Binary mask creation, layer management, and consistency tips.

  1. Open the raw image with Photoshop
  2. Create a new layer and focus on it (avoiding drawing on the raw image layer)
  3. Fill the new layer with pure black (rgb(0,0,0))
  4. Adjust the opacity of the new layer to 35%
  5. Use the Pencil tool to draw the roots with pure white (rgb(255,255,255))
  6. Export the new layer in PNG format

Useful shortcuts

  • Ctrl + Scroll wheel to scroll horizontally
  • Alt + Scroll wheel to zoom in or out
  • Ctrl + C to undo and Ctrl + Shift + C to redo

Songshen Method

Description of our preprocessing and labelling pipeline.

Step 1: Image Preprocessing

  • Go to https://liblib.art/sd and sign in or sign up using WeChat.
  • Scroll down and click ControlNet, then upload the original image.
  • Tick Enable, Perfect Pixel, and Allow Preview.
  • Under Control Type, select Lineart.
  • For Preprocessor, select Invert.
  • For Ending Control Step, set 1.
  • Click Run & Preview on the right side of the Preprocessor section.
  • Return to ControlNet and save the image from Preprocessor Preview (flip vertically if needed).
  • If you don’t use WeChat, use https://www.shakker.ai/sd, which achieves the same effect.

Step 2: Adjustments in Photoshop (PS)

  1. Open the preprocessed image in Photoshop. Press Ctrl+J to duplicate the layer, then hide Layer 0 (the original).
  2. Go to Image → Adjustments → Brightness/Contrast, set Contrast = 100.
  3. Open the Channels panel. Identify the channel with best contrast (e.g., Green), right-click it, and Duplicate Channel.
  4. With the duplicated channel selected: Ctrl+A (Select All), Ctrl+C (Copy). Switch back to Layers, Paste, and hide the original duplicate layer so you only work on the pasted channel copy.
  5. Go to Image → Adjustments → Levels:
    • Right slider ≈ 237
    • Left slider ≈ 55
    • Mid slider ≈ 0.85
    • Use Preview to check results.
  6. Go to Filter → Sharpen → Smart Sharpen. Set Radius ≈ 7.5 (range 5–10). Zoom in to inspect both thick and thin roots.
  7. Go to Filter → Other → High Pass. Set Radius ≈ 50 (range 40–60).
  8. Go to Image → Adjustments → Invert (roots become white).
  9. Go to Image → Adjustments → Threshold. Increase threshold (e.g., 162) while zoomed in to validate details.
  10. Compare with the original in another layer; tweak via History if needed.
  11. Save as PNG (no compression).

Step 3: Noise Filtering in Colab

  • Copy code from noiseRemover.ipynb (GitHub) into Google Colab.
  • Upload the PNG from the previous step.
  • Update the filename in code and set min_area ≈ 125.
  • Run to remove noise while preserving details.
  • Save the output as root_mask_filtered.png; optionally do a final clean-up in Photoshop.

Step 4: Updated Adjustments in Photoshop (PS) (Photopea) For similar adjustments without PS: https://www.photopea.com/

  • Select → Focus Area
  • Image → Adjustments → Desaturate
  • Filter → Sharpen → Smart Sharpen (Amount = 250, Radius = 3)
  • Image → Adjustments → Brightness/Contrast
  • Image → Adjustments → Levels
  • Image → Adjustments → Invert
  • Image → Adjustments → Threshold

Manual Drawing Tools

Based on the result from Songshen Method, Step 2, the mask is further refined as follows

Drawing using Photoshop and Huashijie Pro on Pad

Step 1: Create a distinguishable colour difference between the roots and the mask

  • Open the original image and the mask in the same document.
  • Place the original image on the lower layer and the mask on the upper layer.
  • Select the mask layer.
  • Go to Menu → Select → Color Range. Use the Eyedropper tool to click the white area and adjust Fuzziness until the white area is fully selected.
  • Confirm to get a marching ants selection (the white area is selected).
  • Create a new layer and fill it with red or blue (Shift+F5 → Use: Foreground Colour).
  • Deselect the selection (Ctrl+D).

Now the white mask becomes a colored mask (e.g., blue) for easier refinement.

Step 2: Add missing fine roots manually

  • Merge the blue mask and the original image into one layer and set the blue layer’s transparency to 50% so the roots are visible.
  • Add the missing fine roots by hand-drawing blue lines using the Huashijie Pro app on an Android pad.
  • Save the refined blue mask and use Photoshop to resize it back to 3456×5184 to avoid mismatch problems.
  • Use the script convert_colored_mask_to_binary.ipynb to convert the blue mask back into a binary mask. This completes the refinement.

Step 3: Confirm the labelling result

  • Open the final binary mask in SegMATE to verify that all roots are detected and no unwanted regions are included.
  • If unwanted strokes are present, open the mask in Photoshop, set the pen color to black, and draw over the unwanted areas to remove them.

GIMP

Here is steps of using Gimp to visualize your segmentation results (segmentation quality check), Very Very simple, detailed steps:  

  1. File → Open original RGB image
  2. File → "Open as layers" and select the binary mask image
  3. Click “Select” → “By color”, click the white area (roots) in the mask image
  4. Click “Edit” → File with FG (Foreground) color (e.g., blue), you need to set the foreground color beforehand
  5. Ctrl + C (copy)
  6. Ctrl + V (paste), a new layer will be created on the top with the roots in foreground color, you can change the transparency of this layer to semi-transparent
  7. Remove the mask layer below
  8. Click “Select (menu)” → None, now you should see the original RGB image with the roots enhanced in foreground color

3.2 Model User Guide (RPT)

_The following details the overview of the Root Phenotyping Toolbox (RPT) setup and configuration. It will detail the Model structure and dependencies (UNet + CBAM + subpixel convolution), and provide instructions to train, test, and evaluate the model. _

Preparing the Dataset

  • Place the original images and masks into the two designated folders (they must match as shown in the reference example).
  • Ensure that the image filenames and mask filenames are the same.
image
  • Run check_dataset_en.py to validate the dataset.
    • If all data formats are correct, you will see a confirmation message.
image

Training

  • Open the GUI and switch to the training interface.
  • Note: Only GPU training is supported.
  • Choose appropriate parameters.
  • Start training.
image

Output

  • The training produces a file in .pdparams format.
  • This output file can be used directly for prediction.
image

Result

Example result screenshot
image image


4. Project Risks

  • Technical Risks: Environment mismatch, GPU dependency.
  • Data Quality Risks: Inconsistent labeling, soil noise interference.
  • Continuity Risks: Knowledge transfer gaps, incomplete documentation.

Mitigation Recommendations:
Document setup steps, maintain dataset versioning, and validate model checkpoints regularly.


5. Project Backlog

  • Remaining development tasks (e.g., retraining, hyperparameter tuning).
  • Planned improvements or experiments not yet completed.
  • Known issues and bugs tracked during testing.
  • Future opportunities (e.g., integration with phenotyping pipelines).

6. Project Advice

  • Maintain data quality and reproducibility with clear version control.
  • Use consistent preprocessing pipelines for all datasets.
  • Scale model training with GPU or cloud-based resources.
  • Consider publishing findings or open-sourcing components for community validation.
  • Suggested next steps: further model comparison, dataset expansion, and deployment.

7. Appendices (Optional)

  • Dataset descriptions and file structure.
  • Summary of code modifications to original research papers.
  • References to papers used and model performance summaries.

Clone this wiki locally