The following warnings occurred:
Warning [2] Undefined variable $can_link - Line: 6 - File: showthread.php(1658) : eval()'d code PHP 8.5.12 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php(1658) : eval()'d code 6 errorHandler->error_callback
/showthread.php 1658 eval




Color Deconvolution / "Depainting"
#18
(10-12-2024, 01:51 AM)ReneZ wrote: You are not allowed to view links. Register or Login to view.Did you do the training on labeled data? How exactly?

I take an original TIFF into an image editor, mark some areas of interest with a distinctive color (specific to the desired predicted class) and cover the rest with neutral grey. Then the training script reads the original TIFF and the marked file, extracts the desired values from the marked file, treating each distinct color value as a separate class (and ignoring grey ares), then extracts 3x3 kernels of the same pixels from the original TIFFs, shuffles them (can be skipped for models that don't process data sequentially, e.g., linreg, but important for models that work on batched data) and trains the model. 

I've labelled 4 images this way, using those that show various colors.  On each image I only label (manually, with a pixel brush) a small subset of features, maybe 0.1% or less of all that is present. Normally it takes no more than 10-15 minutes to label an image this way. When adding marks, I'm primarily targeting areas which can be clearly identified visually, but could be challenging for an algorithm with no spacial awareness (e.g., faint lines with clearly visible beginning and ending, lines coming partially under paint, etc). Normally I split my labels between 50% of clearly identifiable features and 50% of features that I can only extrapolate from spacial clues, but the model will have to learn them the hard way using local pixel values only. After finishing the training, I applied the resulting model to the whole set.

The following image shows the markup used for f69r, the original on the left, the image after adding color labels in the middle and the final markup image as seen by the model on the right. For training the model receives the leftmost and the rightmost images as its only input (other than the hyperparameters of the model). For prediction it only receives the original TIFFs with no annotations.

Note that the model is trained to separate various paint colors and ink into different layers, not to remove color, I "converted" it to paint removal tool by setting white color to all paint classes in post processing step. It's likely the results could be better if I train it to specifically remove paint by leaving just two training classes - ink and everything else.

   
[+] 2 users say Thank You to oshfdk for this post
Reply


Messages In This Thread
RE: Color Deconvolution / "Depainting" - by ReneZ - 05-12-2024, 12:10 AM
RE: Color Deconvolution / "Depainting" - by ReneZ - 05-12-2024, 10:56 AM
RE: Color Deconvolution / "Depainting" - by bi3mw - 05-12-2024, 11:18 AM
RE: Color Deconvolution / "Depainting" - by ReneZ - 06-12-2024, 12:00 AM
RE: Color Deconvolution / "Depainting" - by ReneZ - 08-12-2024, 12:39 AM
RE: Color Deconvolution / "Depainting" - by ReneZ - 09-12-2024, 07:26 AM
RE: Color Deconvolution / "Depainting" - by ReneZ - 10-12-2024, 01:51 AM
RE: Color Deconvolution / "Depainting" - by oshfdk - 10-12-2024, 04:38 AM
RE: Color Deconvolution / "Depainting" - by Mauro - 10-12-2024, 05:33 PM
RE: Color Deconvolution / "Depainting" - by ReneZ - 11-12-2024, 01:23 AM
RE: Color Deconvolution / "Depainting" - by ReneZ - 11-12-2024, 11:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Was the color original? A (very crude) analysis of color in Herbal A and Herbal B addekallstrom 6 6,474 09-11-2024, 01:46 AM
Last Post: R. Sale

Forum Jump:


Users browsing this thread: 1 Guest(s)