๐ The Segment Anything Model (SAM) has been upgraded... to SAM2, featuring an efficient image encoder for segmenting images and videos. But does SAM2 outperform SAM1 in medical image and video segmentation? We're thrilled to present our paper "Segment Anything in Medical Images and Videos: Benchmark and Deployment"! We comprehensively benchmark SAM2 across 11 medical image modalities and videos. ๐ Paper: ๐ป Code: **Highlights:** 1. SAM2 doesnโt always outperform SAM1 in 2D medical images, but excels in video segmentation, making it more accurate and efficient for 3D images, such as CT and MR scans. 2. MedSAM still outperforms SAM2 on most 2D modalities, but SAM2 surpasses MedSAM for 3D image segmentation in a slice-by-slice approach. 3. Segmentation performance varies with model size; sometimes the smallest model outperforms larger ones. 4. Fine-tuning SAM2 significantly boosts its performance for medical image segmentation. While SAM2 may struggle with challenging objects that have unclear boundaries or low contrast, it excels in generating good initial segmentation masks for common medical images and videos. However, the official interface doesnโt support medical data formats and has limitations on video length. To address this, we've developed a 3D Slicer Plugin and Gradio API for efficient 3D medical image and video segmentation. We invite you to try them out and provide feedback! ๐ง Deployment: - 3D Slicer Plugin: - Gradio API: (Note: Due to GPU limitations, the online API is available for only 12 hours and may be slow. We highly recommend deploying the Gradio API with your own computing resources: A big shoutout to Jun Ma (JunMa) who recently joined our UHN AI hub (UHN AI Hub) as Machine Learning Lead, and kudos to all co-authors: Sumin Kim, Feifei Li, Mohammed Baharoon (Mohammed Baharoon), Reza Asakereh, and Hongwei Lyu! This is true teamwork! Looking forward to collaborating with the community to advance 3D medical image and video segmentation foundation models! University Health Network U of T Department of Computer Science Department of Laboratory Medicine & Pathobiology Temerty Centre for AI in Medicine (T-CAIREM) Vector Institute #MedTech #AIinHealthcare #DeepLearning #MedicalImaging #SAM2 #MedSAM #AIResearchshow more

Bo Wang
178,481 views โข 1 year ago
๐ The best way to start the week is... to find out that our MedSAM is finally published today in Nature Communications! **Segment anything in medical images** Paper: arXiv: Data & Code: MedSAM is the first promotable foundation model for medical image segmentation. **Highlights**: โญ Before its formal publication, we have received 220 citations and 1400+ GitHub stars ๐๐โค๏ธโ๐ฅโค๏ธโ๐ฅโค๏ธโ๐ฅ ๐ We curated a large-scale medical image dataset with 1,570,263 image-mask pairs, covering 10 imaging modalities and over 30 cancer types. ๐ Built on top of SAM (AI at Meta ) with transfer learning, we have significantly enhanced its segmentation performance of medical images. ๐ Comprehensive evaluations of 86 internal validation tasks and 60 external validation tasks demonstrate its better accuracy and robustness than modality-wise specialist models. **What is Next? --- Clinical Translation!!** ๐Our next goal is to make the model deployable on laptops (CPUs) or other edge devices without reliance on GPUs. We have distilled a lightweight model, LiteMedSAM, offering a speed boost of 10x while maintaining accuracy. Plus, we have integrated it into the 3D Slicer plugin, providing an efficient tool for medical image segmentation. ๐ To further promote developments in this field, we organize a competition on #CVPR2026: Segment Anything in Medical Images on Laptop! An out-of-the-box baseline has been released to reduce the entry barriers. Welcome to join us to push the boundary further: ๐ Massive thanks to MetaAI AI at Meta for their open-source project SAM and many reviewers/users for their invaluable feedback. A huge shoutout to my postdoc Jun Ma (JunMa) for his leadership on this project!! UHN AI Hub Vector Institute Peter Munk Cardiac Centre AI Department of Laboratory Medicine & Pathobiology U of T Department of Computer Science University of Toronto University Health Network Brad Wouters ๐จ๐ฆ Barry Rubin MD, PhD, FRCSC Shaf Keshavjeeshow more

Bo Wang
140,208 views โข 2 years ago
Exciting news! Our MedSAM is featured in Computer Vision... News! ๐๐๐๐ Check it out: We are not stopping at papers and aiming to take integration to the next level by incorporating MedSAM with 3D Slicer, a top-tier medical imaging viewer. ๐ฅ **Segment Anything in Medical Images!** Read the paper here: Get your hands on the code: Explore MedSAM@3Dslice: Huge shoutout to the lead contributor, Jun Ma (JunMa), and a big thank you to Reza Asakereh for his invaluable contributions to MedSAMSlicer! ๐ #MedSAM #MedicalImagingshow more

Bo Wang
19,527 views โข 2 years ago
LLaVA-3D A Simple yet Effective Pathway to Empowering LMMs... with 3D-awareness Recent advancements in Large Multimodal Models (LMMs) have greatly enhanced their proficiency in 2D visual understanding tasks, enabling them to effectively process and understand images and videos. However, the development of LMMs with 3D-awareness for 3D scene understanding has been hindered by the lack of large-scale 3D vision-language datasets and powerful 3D encoders. In this paper, we introduce a simple yet effective framework called LLaVA-3D. Leveraging the strong 2D understanding priors from LLaVA, our LLaVA-3D efficiently adapts LLaVA for 3D scene understanding without compromising 2D understanding capabilities. To achieve this, we employ a simple yet effective representation, 3D Patch, which connects 2D CLIP patch features with their corresponding positions in 3D space. By integrating the 3D Patches into 2D LMMs and employing joint 2D and 3D vision-language instruction tuning, we establish a unified architecture for both 2D image understanding and 3D scene understanding. Experimental results show that LLaVA-3D converges 3.5x faster than existing 3D LMMs when trained on 3D vision-language datasets. Moreover, LLaVA-3D not only achieves state-of-the-art performance across various 3D tasks but also maintains comparable 2D image understanding and vision-language conversation capabilities with LLaVA.show more

AK
41,736 views โข 1 year ago
๐ข๐ข ๐๐๐ซ๐๐๐๐๐: ๐๐๐ซ๐๐๐ฉ๐ญ๐ฎ๐๐ฅ ๐๐๐๐ ๐๐จ๐๐๐ฅ ๐๐จ๐ซ ๐๐ข๐ง๐ ๐ฅ๐-๐๐ฆ๐๐ ๐ ๐๐ ๐๐๐๐... ๐๐๐๐จ๐ง๐ฌ๐ญ๐ซ๐ฎ๐๐ญ๐ข๐จ๐ง & ๐๐๐ข๐ญ๐ข๐ง๐ ๐ข๐ข PercHead reconstructs realistic 3D heads from a single image and enables disentangled 3D editing via geometric controls and style inputs from images or text. At its core is a generalized 3D head decoder trained with perceptual supervision from DINOv2 and SAM 2.1. We find that our new perceptual loss formulation improves reconstruction fidelity compared to commonly-used methods such as LPIPS. Our trained reconstruction model is able to generate 3D-consistent heads from a single input image. Even with challenging side-view inputs, the model robustly infers missing regions for a coherent, high-fidelity output. In addition, our architecture seamlessly adapts to downstream tasks: by swapping the encoder, we can transform the model into a disentangled 3D editing pipeline. In this scenario, we can control geometry through - potentially hand-drawn - segmentation maps, and condition style via image or text prompt. We also provide an interactive GUI to enable the exploration of our editing pipeline. ๐ ๐ฝ๏ธ Great work by Antonio Oroz and Tobias Kirschsteinshow more

Matthias Niessner
18,855 views โข 8 months ago
โจ Made a new mini feature on Photo AI:... [ Grab from 3d model ] So the problem is we're at that stage in time (typical for AI) where image-to-3d models are not good enough but are fun to play with, but we know they'll be good enough in 1-2 years With [ Make 3d model ] you already can turn any Photo AI pic into a 3d model but it still looks hyper clunky and deformed, but it works! One cool idea I had to make that more useful and made now: Let people make a 3d model then change the view of the it with the 3d viewer, then press [ o ] and it grabs a frame of the 3d That image you can then [ Remix ] (img2img), and it becomes a real photo again and that in turn you can then turn into a video again with [ Make video ] So that essentially gives you a fully freeform camera position control to take photos with One thing I need to fix is the background/skybox, I kinda need to take the original photo and remove the person and just get the background for the 3d model viewer, in this case it should be white, but it's a start!show more

@levelsio
119,210 views โข 1 year ago
Collaborative Score Distillation for Consistent Visual Synthesis paper page:... Generative priors of large-scale text-to-image diffusion models enable a wide range of new generation and editing applications on diverse visual modalities. However, when adapting these priors to complex visual modalities, often represented as multiple images (e.g., video), achieving consistency across a set of images is challenging. In this paper, we address this challenge with a novel method, Collaborative Score Distillation (CSD). CSD is based on the Stein Variational Gradient Descent (SVGD). Specifically, we propose to consider multiple samples as "particles" in the SVGD update and combine their score functions to distill generative priors over a set of images synchronously. Thus, CSD facilitates seamless integration of information across 2D images, leading to a consistent visual synthesis across multiple samples. We show the effectiveness of CSD in a variety of tasks, encompassing the visual editing of panorama images, videos, and 3D scenes. Our results underline the competency of CSD as a versatile method for enhancing inter-sample consistency, thereby broadening the applicability of text-to-image diffusion models.show more

AK
33,500 views โข 3 years ago
๐ข๐ข ๐๐ฏ๐๐ญ๐๐ซ ๐ข๐ข Avat3r creates high-quality 3D head avatars... from just a few input images in a single forward pass with a new dynamic 3DGS reconstruction model. Video: Project: Our core idea is to make Gaussian Reconstruction Models animatable. We find that a simple cross-attention to an expression code sequence is already sufficient to model complex facial expressions. We then incorporate position maps from DUSt3R and feature maps from Sapiens to facilitate the prediction task. While DUSt3R's position maps act as a pixel-aligned initialization for the Gaussians' positions, the Sapiens feature maps help the cross-view transformer to match corresponding image tokens in the 4 input images. One major challenge in creating a 3D head avatar from smartphone images comes from inconsistent facial expressions when the subject could not remain perfectly static during the capture. We eliminate this static requirement by simply showing our model input images with different facial expressions during training. This technique makes our model robust to inconsistent input images later on. Finally, we show that despite the model has been trained with 4 input images, one can even create a 3D head avatar when only a single image is available. To achieve this, we employ a pre-trained 3D GAN to lift the single image to 3D and then render the 4 input images for our model. This allows us to create 3D head avatars from single images and even highly out-of-distribution examples like AI generated faces, paintings or statues. Great work by Tobias Kirschstein from his internship at Meta with Javier Romero, Artem Sevastopolsky, and Shunsuke Saitoshow more

Matthias Niessner
74,698 views โข 1 year ago
Tested this concepting workflow. โถ๏ธ Converting a level design... image to a 3D asset gallery image โถ๏ธ re-generating segmented subjects into separate high quality images. โถ๏ธ using these images to generate the 3D meshes. First time using 'for loops' in ComfyUI, works great and the prompts are updated for every segment. I used the Nano Banana 2 API node in ComfyUI to generate the final high quality images. Those SAM3 nodes are crazy btw, just set some points and it creates a mask! For the 3D model generation I used the new Tripo Smart Mesh tool, which is fast! The output is not perfect yet. I think in a lot of cases not production ready right now but that depends on the input image and the goal as well. For pre-production / concepting phase it's perfect and for far distance meshes itโs fine. Iโm sure these tools keep improving, curious what we can work with in 3-6 months. Minimal cleanup and scaling in Blender and tested the meshes in UEFN / Unreal Engine. After creating the ComfyUI workflow it took less than an hour to do everything.show more

Jerome | InsaneUnreal
17,267 views โข 4 months ago
Code and data are now online for CameraHMR, our... state-of-the-art parametric 3D human pose and shape (HPS) estimation method that will appear at hashtag#3DV2025. There are 4 key contributions that make it so accurate and robust: 1. To get accurate 3D shape and pose as well as good alignment to image features, you need to know the focal length of the camera. To solve this, we train HumanFOV to compute the field of view. 2. We introduce CameraHMR, which integrates HumanFOV into HMR2.0 to exploit the estimated focal length. 3. To get accurate pseudo ground truth (pGT) training data, we compute the focal length for images in 4DHumans dataset and modify SMPLify to take this into account. 4. But SMPLify only uses sparse 2D keypoints, which do not capture body shape. So we train a dense surface keypoint detector, DenseKP, on BEDLAM and run it on 4DHumans, resulting in improved body shape. The resulting method is CamSMPLify. We iterate training CameraHMR and running CamSMPLify on the training set initialized with CameraHMR. This results in much improved pGT for 4DHumans and a SOTA single-image HMR method.show more

Michael Black
21,696 views โข 1 year ago
This is probably the most complex workflow Iโve ever... built, only with open-source tools. It took my 4 days. It takes four inputs: author, title, and style; and generates a full visual animated story in one click in ComfyUI . I worked on it for four days. There are still some bugs, but hereโs the first preview. Hereโs a quick breakdown: - The four inputs are sent to LLMs with precise instructions to generate: first, prompts for images and image modifications; second, prompts for animations; third, prompts for generating music. - All voices are generated from the text and timed precisely, as they determine the length of each animation segment. - The first image and video are generated to serve as the title, but also as the guide for all other images created for the video. - Titles and subtitles are also added automatically in Comfy. - I also developed a lot of custom nodes for minor frame calculations, mostly to match audio and video. - The full system is a large loop that, for each line of text, generates an image and then a video from that image. The loop was the hardest part to build in this workflow, so it can process either a 20-second video or a 2-minute video with the same input. - There are multiple combinations of LLMs that try to understand the text in the best way to provide the best prompts for images and video. - The final video is assembled entirely within ComfyUI. - The music is generated based on the LLM output and matches the exact timing of the full animation. - Done! For reference, this workflow uses a lot of models and only works on an RTX 6000 Pro with plenty of RAM. My goal is not to replace humans, as Iโll try to explain later, this workflow is highly controlled and can be adapted or reworked at any point by real artists! My aim was to create a tool that can animate text in one go, allowing the AI some freedom while keeping a strict flow. I donโt know yet how Iโll share this workflow with people, I still need to polish it properly, but maybe through Patreon. Anyway, I hope you enjoy my research, and letโs always keep pushing further! :)show more

Lovis Odin
58,571 views โข 10 months ago
As I promised yesterday, I'll briefly explain LoRA training... and share a workflow I made so you can do it quickly. First, let me answer a very common question: 'Why train LoRAs when we have such advanced models?' Even though we have incredibly advanced models now (like NBP), we still can't always get them to do specific things we want. Simplest example: the spritesheet LoRA I made the other day. I generated 1000 images with Nano Banana and only 100 were what I wanted. The LoRA I trained using those 100 images gives me nearly 100% consistent results. Second point is cost and speed. With LoRA, we can cut costs by 4-5x. And while doing that, we're generating 4-5x faster. How many images do you need for a good LoRA? This depends on your LoRA's complexity. For example, when I training the spritesheet LoRA, even though I used 100 images, I didn't include buildings in the training data, so this LoRA doesn't work for buildings. So think about your LoRA's use cases and add examples for as many use cases as possible to improve quality. What are paired images and how to train LoRAs for image-editing? When training LoRAs for image editing on fal, we call each edit example paired images - one with _start suffix, one with _end suffix. For example, if you're training a background remove LoRA, the unedited original photo will be your '_start' image. The image with background removed will be the '_end' image. Simply put: images we want to edit or use as reference get _start, target images we want to achieve get '_end'. Important: save both images with the same name. Like image332_start.jpg and image332_end.jpg. This way the system knows which images pair together. What about training LoRAs for models with multiple image inputs? Same logic. We still use _start and _end suffixes, but with one difference. Since there are multiple input images, we can number them: _start, _start1, _start2. Example: start images, 1st image = Woman portrait (image35_start.jpg) 2nd image = Glasses photo (image35_start1.jpg) 3rd image = Hat photo (image35_start2.jpg) Output image = portrait of woman wearing glasses and hat (image35_end.jpg) Can we do more detailed captioning? Yes. Similarly, you can improve training quality by creating a txt file for each set with the caption inside. Example: create image35.txt and write: 'Recreate the image by putting the glasses from the second image and the hat from the third image on the woman in the first image.' What are Steps? How many should I use? What's Learning Rate? Steps determines how many times the model sees and processes your training data (your images). Each step, the model learns a bit more. But as steps increase, so does the risk of overfitting. So there's no real default. But for a simpler LoRA with 20 paired images, 1000 steps is ideal. Here's a metaphor for the Steps and Learning Rate relationship: Imagine you have a balloon. Our goal is to inflate it to the optimal size. Steps = How many times we blow into the balloon Learning rate = How hard we blow each time If we blow too softly, we need to blow many more times. If we blow too hard, we risk popping it quickly and can't reach optimal size. Of course training won't explode, but it won't work as intended because it wasn't trained optimally. Training's done, now what? Once training's complete, you'll have a safetensors file. Every model you train on fal has a LoRA inference endpoint. In that inference, add your safetensors file link to the LoRA url input, and you can use your LoRA. Thanks for the read! The workflow in the video: If I forgot anything, let me know in the replies.show more

ilker
15,133 views โข 5 months ago
Weโre shipping two major updates to streamline your creative... workflow, allowing you to generate high-speed images with one model and then instantly animate them with the otherโall at a fraction of the cost ๐โก๏ธ 1๏ธโฃ Introducing Nano Banana 2 Lite: Our fastest and most cost-efficient Gemini Image model yet delivers text-to-image outputs in under 4 seconds. Now available via the Gemini API and Google AI Studio, and rolling out soon across @NotebookLM, Google Flow, Google Gemini, Stitch by Google, Google Search and Google Photos. 2๏ธโฃ Gemini Omni Flash in Public Preview: Our natively multimodal model for cost-efficient video generation and conversational editing. Now available via the Gemini API, Google AI Studio, and Gemini Enterprise Agent Platform so you can integrate the model into your workflow. While exciting on their own, the real magic happens when you build using these models together. Watch how our interior design demo integrates Nano Banana 2 Lite and Omni to instantly reimagine any space. Upload a photo, swipe through tailored design concepts, and see Omni bring the details to life in cinematic motion. Try out the demo app in AI Studio:show more

Google AI
119,113 views โข 17 days ago
Google presents Still-Moving Customized Video Generation without Customized Video... Data Customizing text-to-image (T2I) models has seen tremendous progress recently, particularly in areas such as personalization, stylization, and conditional generation. However, expanding this progress to video generation is still in its infancy, primarily due to the lack of customized video data. In this work, we introduce Still-Moving, a novel generic framework for customizing a text-to-video (T2V) model, without requiring any customized video data. The framework applies to the prominent T2V design where the video model is built over a text-to-image (T2I) model (e.g., via inflation). We assume access to a customized version of the T2I model, trained only on still image data (e.g., using DreamBooth or StyleDrop). Naively plugging in the weights of the customized T2I model into the T2V model often leads to significant artifacts or insufficient adherence to the customization data. To overcome this issue, we train lightweight Spatial Adapters that adjust the features produced by the injected T2I layers. Importantly, our adapters are trained on "frozen videos" (i.e., repeated images), constructed from image samples generated by the customized T2I model. This training is facilitated by a novel Motion Adapter module, which allows us to train on such static videos while preserving the motion prior of the video model. At test time, we remove the Motion Adapter modules and leave in only the trained Spatial Adapters. This restores the motion prior of the T2V model while adhering to the spatial prior of the customized T2I model. We demonstrate the effectiveness of our approach on diverse tasks including personalized, stylized, and conditional generation. In all evaluated scenarios, our method seamlessly integrates the spatial prior of the customized T2I model with a motion prior supplied by the T2V model.show more

AK
40,474 views โข 2 years ago
Want to create an avatar from a single image?... FlexAvatar is a transformer model that creates full 360ยฐ, high-quality, and expressive 3D head avatar from just a single portrait image in minutes. Real-time Demo: FlexAvatar's lightweight architecture allows both animation and rendering in real-time, enabling interactive user experiences. To create a new 3D head avatar, only one image is required, e.g., from a webcam. The final avatar is ready after 2 minutes. Architecture: Under the hood, FlexAvatar adopts a transformer-based encoder-decoder design. The encoder maps the input image onto a latent avatar space, while the decoder produces 3D Gaussian attribute maps by incorporating the animation signal via cross-attention. The model learns all facial animations directly from the data without relying on pre-built 3D face models. This equips the avatars with realistic facial expressions. The internal avatar latent space can be conveniently used to integrate additional observations of a person via fitting. This enables use-cases where more than one image of a person is available, e.g., from a phone scan of the person. We train jointly on 2D monocular videos and multi-view data. However, in monocular videos, the animation signal leaks the target viewpoint, causing the model to produce incomplete 3D heads. We call this phenomenon entanglement of driving signal and target viewpoint. To prevent entanglement, we introduce bias sinks. These are learnable tokens that indicate whether a training sample stems from a monocular or a multi-view dataset. During training, the model learns to produce incomplete 3D heads only when the monocular token is present. During inference, FlexAvatar then always uses the multi-view token for which the model has learned to produce complete 3D heads. This simple design allows to combine the generalizability from monocular data with the quality of multi-view data. FlexAvatar summary: - Input: Single-image, phone scan, or monocular video - Output: Full 360ยฐ head avatar - Expressive animations - Real-time rendering and animation - Generalization to any portrait - Create a new avatar in 2 minutes - Use bias sinks to combine 2D and 3D data ๐ ๐ ๐ฅ Great work by Tobias Kirschstein and Simon Giebenhain!show more

Matthias Niessner
95,991 views โข 7 months ago
In our research lab, we are building โreal-time dreamingโ... - the ability to generate fully playable video worlds prompted from any text or image. Our real-time, action conditioned world model (currently running internally at 16fps at 832x480p) is trained on a combination of data, including proprietary Roblox 3D avatar/world interaction data. World models are different from multiplayer engines in that they store state and memory in video latents. Roblox is multiplayer, and we are actively researching optimal ways to simultaneously store state for thousands of players, and keep them in sync with their environment. Our world model leverages database technology which stores all user interactions on Roblox in a vector format that can be used to re-render video and interaction from any camera angle. We see several immediate uses for our Roblox world model. We will use it side-by-side text, image and video prompts as a way to launch auto-generation of immersive worlds. In Roblox Studio, a creator could walk around and use prompts to โpaintโ a world and then convert it into a 3D representation or direct to Roblox native as a way for many people to play simultaneously. All of this comes alive as we explore the notion of a โDream Theaterโ - where one user is dreaming, while others watch and prompt them. 2/4show more

Roblox
4,392,269 views โข 5 months ago
Google DeepMind just dropped 'Genie', an AI that can... generate interactive video games. This is a huge deal. Genie is trained on 200,000 hours of unsupervised public internet gaming videos and can generate video games from a single prompt or image. But here's what's insane: Despite not being trained on action or text annotations, the foundation model can determine who the main character is and enable a user to control that character in the generated world. It does this through its Latent Action Model, Video Tokenizer, and Dynamics Model (will go more in-depth on this in tomorrow's newsletter for those interested). And for those asking, yes, it's research-only and not publicly available (here come the Google memes), and it does come with some limitations, like only currently creating games at 1FPS. But this is the worst AI will ever be. Anyone will be able to create their own entirely imagined virtual worlds soon, and that's a wild sentence to say out loud.show more

Rowan Cheung
3,376,915 views โข 2 years ago
It still blows my mind that we can create... promo videos for brands in 1 hour. I recently worked with an upcoming fabric brand to integrate AI into their processes. Feeling confident in the tools, I thought, "Why not draft up a promo video with them?" I selected a few images from their website, generated more to fit the theme, and ran them through Image-2-Video in Runway. One hour later, we had a promo video. ๐คฏ A year ago, something like this would have never occurred due to the logistics and resources needed to do such a project. Now, they can put 3 creatives on a project like this, create multiple videos, and run test ads on socials to see which performs best. All in a matter of hours and days.show more

Nicolas Neubert
153,305 views โข 2 years ago
Introducing "Building with Llama 4." This short course is... created with Meta AI at Meta, and taught by Amit Sangani, Director of Partner Engineering for Metaโs AI team. Metaโs new Llama 4 has added three new models and introduced the Mixture-of-Experts (MoE) architecture to its family of open-weight models, making them more efficient to serve. In this course, youโll work with two of the three new models introduced in Llama 4. First is Maverick, a 400B parameter model, with 128 experts and 17B active parameters. Second is Scout, a 109B parameter model with 16 experts and 17B active parameters. Maverick and Scout support long context windows of up to a million tokens and 10M tokens, respectively. The latter is enough to support directly inputting even fairly large GitHub repos for analysis! In hands-on lessons, youโll build apps using Llama 4โs new multimodal capabilities including reasoning across multiple images and image grounding, in which you can identify elements in images. Youโll also use the official Llama API, work with Llama 4โs long-context abilities, and learn about Llamaโs newest open-source tools: its prompt optimization tool that automatically improves system prompts and synthetic data kit that generates high-quality datasets for fine-tuning. If you need an open model, Llama is a great option, and the Llama 4 family is an important part of any GenAI developer's toolkit. Through this course, youโll learn to call Llama 4 via API, use its optimization tools, and build features that span text, images, and large context. Please sign up here:show more

Andrew Ng
67,710 views โข 1 year ago
Explore state-of-the-art multimodal prompting in our new short course... Large Multimodal Model Prompting with Gemini, taught by Erwin Huizenga in collaboration with Google Cloud. One interesting insight from this course: with multimodal models, prompt structure matters significantly. Placing text inputs, such as a patient's medical history, before image inputs, like an X-ray, can enhance the model's ability to contextualize and interpret visual data effectively. In other contexts, such as image captioning, you may get better results by putting the image first. Multimodal models behave differently than text-only LLMs, and effective prompting for models varies depending on the model youโre using. In this course youโll learn how to effectively prompt Gemini models. Gemini's multimodal capabilities also enable new approaches in AI application development, for example: - The Gemini library handles various video formats (MP4, MOV, MPEG), streamlining applications using these formats. - Large context window (up to 1 million tokens) enables processing of extensive content, like analyzing multiple 50-minute videos simultaneously. - Function calling feature integrates real-time data (e.g., current exchange rates) into model responses. The course demonstrates building multimodal applications with real-world examples including document analyzers that reason across text and graphs simultaneously, video content extractors that find and timestamp specific information from multiple hours of footage, and automated expense report systems processing receipt images while cross-referencing company policies. Sign up here:show more

Andrew Ng
74,060 views โข 1 year ago
[CLIP] by Hand โ๏ธ The CLIP (Contrastive LanguageโImage Pre-training)... model, a groundbreaking work by OpenAI, redefines the intersection of computer vision and natural language processing. It is the basis of all the multi-modal foundation models we see today. How does CLIP work? Goal: ๐จ Learn a shared embedding space for text and image [1] Given โณ A mini batch of 3 text-image pairs โณ OpenAI used 400 million text-image pairs to train its original CLIP model. Process 1st pair: "big table" [2] ๐ช Text โ 2 Vectors (3D) โณ Look up word embedding vectors using word2vec. [3] ๐ฉ Image โ 2 Vectors (4D) โณ Divide the image into two patches. โณ Flatten each patch [4] Process other pairs โณ Repeat [2]-[3] [5] ๐ช Text Encoder & ๐ฉ Image Encoder โณ Encode input vectors into feature vectors โณ Here, both encoders are simple one layer perceptron (linear + ReLU) โณ In practice, the encoders are usually transformer models. [6] ๐ช ๐ฉ Mean Pooling: 2 โ 1 vector โณ Average 2 feature vectors into a single vector by averaging across the columns โณ The goal is to have one vector to represent each image or text [7] ๐ช ๐ฉ -> ๐จ Projection โณ Note that the text and image feature vectors from the encoders have different dimensions (3D vs. 4D). โณ Use a linear layer to project image and text vectors to a 2D shared embedding space. ๐๏ธ Contrastive Pre-training ๐๏ธ [8] Prepare for MatMul โณ Copy text vectors (T1,T2,T3) โณ Copy the transpose of image vectors (I1,I2,I3) โณ They are all in the 2D shared embedding space. [9] ๐ฆ MatMul โณ Multiply T and I matrices. โณ This is equivalent to taking dot product between every pair of image and text vectors. โณ The purpose is to use dot product to estimate the similarity between a pair of image-text. [10] ๐ฆ Softmax: e^x โณ Raise e to the power of the number in each cell โณ To simplify hand calculation, we approximate e^โก with 3^โก. [11] ๐ฆ Softmax: โ โณ Sum each row for ๐ฉ imageโ๐ช text โณ Sum each column for ๐ช textโ ๐ฉ image [12] ๐ฆ Softmax: 1 / sum โณ Divide each element by the column sum to obtain a similarity matrix for ๐ช textโ๐ฉ image โณ Divide each element by the row sum to obtain a similarity matrix for ๐ฉ imageโ๐ช text [13] ๐ฅ Loss Gradients โณ The "Targets" for the similarity matrices are Identity Matrices. โณ Why? If I and T come from the same pair (i=j), we want the highest value, which is 1, and 0 otherwise. โณ Apply the simple equation of [Similarity - Target] to compute gradients of for both directions. โณ Why so simple? Because when Softmax and Cross-Entropy Loss are used together, the math magically works out that way. โณ These gradients kick off the backpropagation process to update weights and biases of the encoders and projection layers (red borders).show more

Tom Yeh
67,834 views โข 2 years ago