How do you use transfer learning with images with 3+ (or 1) channel(s)?

Timm library, developed by @wightmanr, has an elegant way to handle that:

You can specify any input channel number (e.g. in_chans=1 or in_chans=8) using timm.create_model() function like this:
@wightmanr m = timm.create_model('resnet34', pretrained=True, in_chans=8)

How does it work?

• Case 1: number of input channels is 1
timm simply sums the 3 channel weights into one single channel
@wightmanr • Case 2: number of input channels is 8 (more than 3)
timm repeats the 3 channel weights as many times as required, and then select the required number of input channels weights

In 8 channels example, that would be: repeat 3 times (9 channels generated), then keep the first 8
@wightmanr Kudos to Ross for creating such an incredible library, and to @amaarora for creating an awesome documentation. It's hosted at the @fastai repo.

Direct link to the topic: fastai.github.io/timmdocs/model…
@wightmanr @amaarora @fastai ⭐ If you are interested in mastering Object Detection, follow
@ai_fast_track

⭐ I started a newsletter, join to master object detection

If you find this info helpful, give this thread a quick retweet, and help others discover this content. Thanks!

getrevue.co/profile/ai_fas…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with AI Fast Track (70/70)

AI Fast Track (70/70) Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @ai_fast_track

5 Jan
Here is a mega-summary of my YOLO-Series Visual Summaries:

1- YOLO Family Real-Time Performance
2- IA-YOLO improves object detection in adverse weather conditions using a hybrid task.

Image improvement combined with object detection.
3- YOLO Real-Time (YOLO-ReT) architecture targets edge devices.

Read 8 tweets
3 Jan
🔥 ZSD-YOLO: Zero-Shot YOLO Detection using Vision-Language Knowledge Distillation

Heads up: I’m preparing a visual summary on ZSD-YOLO.

So, what is Zero-Shot Detection?
• Zero-shot detection allows a model to detect something in an image even if the model has never seen that thing before

• So, if you have an image of a Chimpanzee and the model has never seen a Chimpanzee before, you can use your zero-shot detector to locate it in the image
• ZSD-YOLO leverages 2 models:
- CLIP: a pretrained Vision-Language model
- YOLOv5: a modified version that replaces the classification branch
Read 5 tweets
23 Dec 21
Many open-world applications require the detection of novel objects.

but state-of-the-art object detection and instance segmentation models are unable to do so.

• It’s because models learn to suppress any unannotated objects by treating them as background
• To address that issue, the authors propose a simple yet surprisingly powerful data augmentation and training scheme they call Learning to Detect Every Thing (LDET)
• To avoid suppressing hidden (unannotated) objects, background objects that are visible but unlabeled, they paste annotated objects on a background image sampled from a small region of the original image (see figure)
Read 8 tweets
20 Dec 21
❓ What is Multi-Scale Training (MST)?

💡 MTS helps your model to be robust to image sizes, an get better performance

• Training on small images is faster

• Training on large images increases your model performance

How is MST done?
Every N (e.g., 10) epochs, we randomly chooses a new image dimension from a range of sizes [640, 768, 800], and train our model

This means the same network becomes better at predicting at different resolutions.
• In MMDetetection, models trained using multi-scale technique have “_mstrain_” in their name.

• Example: vfnet_r50_fpn_mstrain_2x_coco
Read 5 tweets
14 Dec 21
🔥 Just after one week of learning, my mentee @strickvl:

• Built a dataset of ~ 450 images: redacted documents

• Labelled them using @explosion_ai Prodigy

• Trained a VFNet model using IceVision and @fastdotai

• Reached 73%🚀in the COCO metric score

Blog posts: 👇
📝 Main takeaway of this story is: You can learn object detection very quickly if You:

• Are determined
• Follow the optimal learning path
• Embrace the 80-20, and the KISS principles.
• Have access to high curated content, and libraries
• Know how to avoid roadblocks
• Stay focus, and avoid distraction

✨ Like many things in life, object detection is:
• neither too hard
• nor too easy
• right in between ... when you have the right ingredients
Read 5 tweets
9 Dec 21
Interested in parsing any custom object detection dataset format?

I will show you how easy to parse your dataset, and train one of many IceVision models using your own data.

In this post, I walk you through the steps to parse data stored in CSV files by using the Chess dataset
You can apply the same logic to any other format.

• First, both COCO and VOC formats are transparently supported in IceVision.

• The CSV format is different than the COCO and VOC formats. Hence, the custom parsing.

• IceVision auto-generates your parser class skeleton.
• You only need to connect some attributes to their corresponding ones in your CSV file

• Once done, you instantiate your class, and parse your data

• From there, all the subsequent code is common to any other parsed data.

• Parsed data are a collection of record objects
Read 8 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(