You can find better courses on this channel
Hello Everyone.
I am Pastor Soto. I want to share my work on the first lesson with some customization to make it work with the dataset. I choose an active kaggle competition that predicts skin cancer. The data is heavily imbalance and it only has two categories. I tried to keep as much as possible to the actual material of the course.
I will summarize the modifications:
- The dataset is in a single folder and moving the data to make classification based on the folder name requires to move a lot of files around, so I created a function to make it work with datablocks. Also, as I mention before the dataset is highly imbalance, so I had to make sure we had enough training examples of the positive class.
# Create a dictionary mapping isic_id to target
id_to_target = dict(zip(df['isic_id'], df['target']))
# Custom get_items function
def get_image_files_custom(path):
return [Path(f"{path}/{isic_id}.jpg") for isic_id in df['isic_id']]
# Custom get_y function with error checking
def get_y_func(fname):
isic_id = fname.stem # The filename without extension is the isic_id
target = id_to_target.get(isic_id, None)
if target is None:
print(f"Warning: No target found for {isic_id}")
return target
# Custom balanced splitter
def balanced_splitter(items):
df_items = pd.DataFrame({'path': items, 'label': [get_y_func(item) for item in items]})
train = df_items.groupby('label', group_keys=False).apply(lambda x: x.sample(frac=0.8, random_state=42))
valid = df_items[~df_items.index.isin(train.index)]
return list(train.index), list(valid.index)
After we set the functions we are able to pass into the datablocks
# Set up the DataBlock
dls = DataBlock(
blocks=(ImageBlock, CategoryBlock),
get_items=get_image_files_custom,
splitter=balanced_splitter,
get_y=get_y_func,
item_tfms=[Resize(192, method='squish')],
batch_tfms=[*aug_transforms(), Normalize.from_stats(*imagenet_stats)]
).dataloaders(path, bs=32)
Overall,we use our functions and created a batch transformation to make our examples fit into the model. After this step, everything remains the same as it is in the lectures.
This is not the best model for this problem as the highly imblance dataset assumes most pictures are skin cancer, but at least is a starting point in an ongoing competition. The picture is from a skin cancer example.
This is my notebook, feel free to share ideas or suggestions!
Thanks
zelda_or_pokemon: https://www.kaggle.com/code/adampritchard/zelda-or-pokemon
I wasn’t sure how detecting screenshots of retro video games would go, I thought resnet might struggle with it since my understanding is that it’s trained on imagenet, which I think might be all photos (not sure)
It worked great even with pretty average training data from duckduckgo (I just wanted screenshots but got images of the box-art, photos of the cartridge, wrong versions of the games etc)
Hello Everyone,
I want to share my work after first lesson. I chose to implement traffic signal predictor.
I have expanded the categories to different traffic signals and placing them in their corresponding folders accordingly. I have used resnet34 instead of resnet18 for better outcome for this problem.
I have used dictionary type to search appropriate images and use the same for the verification. The search included traffic lights in different settings like rain, night and day.
Tested the model with different traffic lights and thumb nails for reference.
There is a lot more to learn but I am happy to share my work here.
https://www.kaggle.com/code/venkateshyeluri/traffic-signal-predictor/
Hi all!
I made a classifier that distinguishes between Perry the platypus and Dr. Heinz Doofenshmirtz.
I used quite little data (only 30 photos for each character) but it seems to learn well.
Check out the code here:
Expanding little bit more to this after the second lesson, I have deployed this to huggingface space using gradio. I like what I see
Hey everyone! After the 1st lesson, I created a classifier that distinguishes between baked vs stovetop mac and cheese. This was a pretty fun exercise! I tested 3 epochs of training and then 5. It’s very accurate.
You can see the notebook here: Is it baked? Creating a model from your own data | Kaggle
Nice project, Perry was my favourite from the show.
Would be interesting to try classifying different detective animals, but don’t think there will be enough data.
Hi FastAI course community!
After learning course 1, I updated the notebook in kaggle to classify dog breeds: Dachshund, Doberman, and West Highland White Terrier. They’re so adorable! Which dog breed do you like the most?
- The results look decent.
Well, after finishing the first two lectures of the FastAI course, I built a mini food classifier that classifies images of food as either Pizza, Steak, or Sushi: Mini-FoodClassifier
Malware classifier
Created a leraner which takes malware images and classifies it into different malware families
Got accuracy of 99% which is pretty good considering the training was done for only 4 epochs
Here is my notebook
https://www.kaggle.com/code/vinayhp/fastai-chapter-1
At first I wanted to make a classifier for Doofenshmirtz that would distinguish between Perry the platypus and agent P but it was quite hard to obtain the right data
After learning lesson 1, I updated the notebook in kaggle to classify apes: chimpanzee, orangutan, gorilla. It works pretty well.
I also tried with this kaggle dataset to identify edible vs poisonous fungi. It works quite well.
Dataset - edible and poisonous fungi | Kaggle
Notebook - Fungi Classification using FastAI library | Kaggle
Loving the course!
I worked on augmenting the classic PETS dataset to include my dog a Japanese Spitz.
This was quite a fun exercise as a Japanese Spitz looks similar to a Samoyed.
It was tricky to get good accuracy, and I played around with data augmentation and epochs, but they still did not achieve the accuracy I needed.
What helped was [The best vision models for fine-tuning | Kaggle](best vision models for fine tuning) and selecting different model families until I got something that worked well.
I’m very surprised the model was able to tell the differences between breeds that well.
Give the app a go https://huggingface.co/spaces/CraigRichards/fastai_pet_clasifier and if you need another breed added, let me know.
I also tried with this kaggle dataset to identify the type of tomatoes. It works quite well.
Pre-trained models makes wonders!
Dataset - Tomatoes Dataset | Kaggle
Notebook - Tomatoes classification using FastAI library | Kaggle
Here is my homework 1 that classifies Picasso and Van gogh paintings.
Explanation of the notebook
This notebook is designed to help you understand the function definitions used in the fastai Chapter 1 homework. While classifying different styles of paintings can be complex and typically involves various loss functions and advanced methods, this notebook takes a more approachable and fun route. We’ll be focusing on a simple classification task: determining whether a painting is by Picasso or Van Gogh. This not only makes the learning process engaging but also provides a practical example of how to apply these concepts.
I finished reading chapter 01. I tried the code to classify facial expressions with IMFDB dataset. At the moment I error_rate is high. As I learn more I’ll update it. Sharing my kaggle notebook here. Thank you!
Hey mate,
Congrats. I tried to look at your work but could not find the code.
Would love to take a look.