All videos
0:00 / 0:00
research

I trained an AI Model to Detect Trading Candlesticks (from scratch using ViTs)

Nicholas Renotte16 June 2026Watch on YouTube

Description

So this one’s been a while in the making. Honestly I’ve been pretty keen to truly get my head around vision transformers and figured this project could be the one. It took a month and a half to get it to this point and ton of banging my head against the keyboard to finally get it working (I’m looking at you ColorJitter 😒). I want to keep this one going as a live project so i’ll be monitoring any issues you guys have a bit more closely. If you get stuck let me know and I’ll make as many updates as I can. Anyway, hope you enjoy it guys! Code: https://github.com/nicknochnack/ViTCandlesticks 👨‍💻 Sign up for the Full Stack course and use YOUTUBE50 to get 50% off: https://www.coursesfromnick.com/bundles/fullstackml Stuff I found useful: Albumentations: https://albumentations.ai/docs CutMix/Mixup: https://docs.pytorch.org/vision/main/auto_examples/transforms/plot_cutmix_mixup.html Lucid Rains ViT for PyTorch: https://github.com/lucidrains/vit-pytorch/tree/main/vit_pytorch Oh, and don't forget to connect with me! LinkedIn: https://bit.ly/324Epgo Facebook: https://bit.ly/3mB1sZD GitHub: https://bit.ly/3mDJllD Patreon: https://bit.ly/2OCn3UW Join the Discussion on Discord: https://bit.ly/3dQiZsV Happy coding! Nick

What you'll learn

  • Vision Transformers (ViT) can be used to automatically recognize and classify trading candlestick patterns.
  • PyTorch combined with albumentations, CutMix and Mixup are essential tools for training a robust ViT model for computer vision tasks.
  • Implementation requires attention to details such as ColorJitter configuration and other data augmentation techniques to achieve good results.
  • Open-source code and live project monitoring enable developers to build and debug vision transformer models themselves.

Frequently asked questions

What is a Vision Transformer (ViT) and why was it used for this project?
A Vision Transformer is a deep learning model that applies transformers, normally used for text, to image data. It was chosen for this project because the creator wanted to understand how ViTs work and they prove effective for pattern recognition in images.
Which tools and libraries were used to train the model?
The project uses PyTorch as the base framework, albumentations for data augmentation, CutMix and Mixup for advanced augmentation methods, and Lucid Rains' ViT implementation.
Where can I find the code and full tutorial?
The complete code is available on GitHub at https://github.com/nicknochnack/ViTCandlesticks. The creator provides support and will make updates based on user feedback.
What were the biggest challenges in building this model?
The project took one and a half months and required substantial debugging, with ColorJitter configuration being one of the critical issues that needed to be resolved.

Topics