Answers.Body: <p>How about you make a dataset using patches from your image, and train a CNN model with that dataset?</p>
  <p>That is, if you want to train a neural net, a dataset with 11 images for each class is too small and thus is prone to overfitting.</p>
  <p>However, since your image is high resolution and the printers can be classified by just using the zoomed in images, you can split each of your images into hundreds to thousands of patches and use that as a dataset. That way each of your class (printer) will have data samples equal to <code>11 * num_of_patches_per_image</code>.</p>
  <p>After you make your dataset, train a cnn classifier with 8 classes with it. You can do transfer learning and finetune a pretrained cnn, or I think depending on the amount of data you end up with, you can train a whole new cnn from scratch.</p>
  <p>During inference time, you can pass your cnn model a patch from your test image (or you can pass a dozen of patches and ensemble the results for increased accuracy and robustness).</p>
  <p>P.S.</p>
  <p>With deep learning, you don't really have to worry too much about feature extraction as traditional machine learning. Especially with image-like data. I have a strong feeling that you can probably make a very high-performance model just by doing the above.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-22T09:20:42.410Z
Answers.Text: Yes I know that this is a way to go. But the goal of the task is to find a manual way of feature extraction. We know that each printer are different in terms of their printing algorithm, thus the dot size are different, distances of dots etc. We want to find a way to extract those features with manual approach, if it's possible. So the idea is to to work with classic Image Processing tools like opencv.. is there such a way?
Answers.UserDisplayName: Haidepzai
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-22T09:59:18.500Z
Answers.Text: Does this feature have to be human interpretable? You suggested pretrained cnns above, and they also don’t extract any interpretable features.
Answers.UserDisplayName: DKDK
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-22T10:33:51.673Z
Answers.Text: Yes. I think with pretrained CNN we don't know which features are relevant or not, right? I somehow need to extract the dots and compute the average size (mean) and standard deviation.. these are possible features in my opinion
Answers.UserDisplayName: Haidepzai
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-22T01:28:22.030Z
Answers.LastActivityDate: 2021-11-22T01:39:44.767Z
Answers.LastEditDate: 2021-11-22T01:39:44.767Z
Answers.UserDisplayName: DKDK
Body: <p>I need some advice. I am currently trying to do a printer classification with ML/DL.</p>
  <p>What do I have?</p>
  <p>11 colored-images with high resolution from 8 different inkjet-printers (in total 88 images)
  I have 8 classes (printers)
  All images are scanned with 2.400 dpi, so you are able to see the halftone of the images and the matrix dots
  I know each printers are different in terms of size of matrix dots, dot pattern etc.
  Based on that I need to do a feature extraction and train a ML model which can classify the correct printer. There is a previous work which has been done with Wavelet-Transformation for feature extraction and SVM for classification. The goal now is to find another approach of feature extraction and training.</p>
  <p>My question here is, what do you think is the best solution?</p>
  <p>My idea is:</p>
  <p>Isolate the dots into binary color (black/white)
  do an edge detection with opencv (using filters like sobel, canny etc.)
  But I am not sure if this is a good approach. After reading a lot of papers on related work I found out many used Transfer Learning (e.g. VGG, Resnet) where features are learned in the training process.</p>
  <p>So basically I have images and when you can zoom in you see for each printers the pattern are different. So instead of doing Wavelet-Transformation I need to do another approach.</p>
  <p>In the litarature common feature extractor for this are Gray-levcel Co-Occurences, Wavelet-Transformation, Spartial filters which will be used in SVM or AdaBoost. Another approach is as said above with pre-trained CNN (transfer learning).</p>
  <p>So, what do you think I should tackle next?</p>
  <p><a href="https://i.sstatic.net/HZZAR.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/HZZAR.jpg" alt="enter image description here" /></a></p>
  
Tags: <machine-learning><deep-learning><computer-vision><python><opencv>
Title: Feature Extraction for printer classification
UserDisplayName: Haidepzai
ThreadText: # Feature Extraction for printer classification
  
  (Asked by: username_0 on 2021-11-21)
  
  I need some advice. I am currently trying to do a printer classification with ML/DL.
  
  What do I have?
  
  11 colored-images with high resolution from 8 different inkjet-printers (in total 88 images)
  I have 8 classes (printers)
  All images are scanned with 2.400 dpi, so you are able to see the halftone of the images and the matrix dots
  I know each printers are different in terms of size of matrix dots, dot pattern etc.
  Based on that I need to do a feature extraction and train a ML model which can classify the correct printer. There is a previous work which has been done with Wavelet-Transformation for feature extraction and SVM for classification. The goal now is to find another approach of feature extraction and training.
  
  My question here is, what do you think is the best solution?
  
  My idea is:
  
  Isolate the dots into binary color (black/white)
  do an edge detection with opencv (using filters like sobel, canny etc.)
  But I am not sure if this is a good approach. After reading a lot of papers on related work I found out many used Transfer Learning (e.g. VGG, Resnet) where features are learned in the training process.
  
  So basically I have images and when you can zoom in you see for each printers the pattern are different. So instead of doing Wavelet-Transformation I need to do another approach.
  
  In the litarature common feature extractor for this are Gray-levcel Co-Occurences, Wavelet-Transformation, Spartial filters which will be used in SVM or AdaBoost. Another approach is as said above with pre-trained CNN (transfer learning).
  
  So, what do you think I should tackle next?
  
  [![enter image description here](https://i.sstatic.net/HZZAR.jpg)](https://i.sstatic.net/HZZAR.jpg)
  
  **Tags:** machine-learning, deep-learning, computer-vision, python, opencv
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-11-22. Score: 1
  
  How about you make a dataset using patches from your image, and train a CNN model with that dataset?
  
  That is, if you want to train a neural net, a dataset with 11 images for each class is too small and thus is prone to overfitting.
  
  However, since your image is high resolution and the printers can be classified by just using the zoomed in images, you can split each of your images into hundreds to thousands of patches and use that as a dataset. That way each of your class (printer) will have data samples equal to `11 * num_of_patches_per_image`.
  
  After you make your dataset, train a cnn classifier with 8 classes with it. You can do transfer learning and finetune a pretrained cnn, or I think depending on the amount of data you end up with, you can train a whole new cnn from scratch.
  
  During inference time, you can pass your cnn model a patch from your test image (or you can pass a dozen of patches and ensemble the results for increased accuracy and robustness).
  
  P.S.
  
  With deep learning, you don't really have to worry too much about feature extraction as traditional machine learning. Especially with image-like data. I have a strong feeling that you can probably make a very high-performance model just by doing the above.
  
  > **Comments:**
  > **username_0**: Yes I know that this is a way to go. But the goal of the task is to find a manual way of feature extraction. We know that each printer are different in terms of their printing algorithm, thus the dot size are different, distances of dots etc. We want to find a way to extract those features with manual approach, if it's possible. So the idea is to to work with classic Image Processing tools like opencv.. is there such a way?  
  > **username_1**: Does this feature have to be human interpretable? You suggested pretrained cnns above, and they also don’t extract any interpretable features.  
  > **username_0**: Yes. I think with pretrained CNN we don't know which features are relevant or not, right? I somehow need to extract the dots and compute the average size (mean) and standard deviation.. these are possible features in my opinion  
  
  ---
  
  