DigitalSreeni
DigitalSreeni
  • 420
  • 8 592 394
Comparing Top Large Language Models for Python Code Generation
A video walkthrough of up an experiment testing various large language models for generating hashtag #Python code for scientific image analysis.
The task: segment nuclei in a multichannel hashtag #microscopy image (proprietary format), measure mean intensities of other channels in the segmented nuclei regions, calculate ratios and report in csv.
All well-hyped models are tested:
- Claude 3.5 Sonnet
- ChatGPT-4o
- Meta AI Llama 3.1 405-B
- Google Gemini 1.5 Flash
- Microsoft Copilot (in God's name, how do I find the model name?)
All generated code can be found here: github.com/bnsreenu/python_for_microscopists/tree/master/340-Comparing%20Top%20Large%20Language%20Models%20for%20Python%20Code%20Generation
A summary of my findings:
- When I didn't specify how to segment, all needed a bit of hand-holding. Claude did the best here.
- When I asked for Stardist segmentation, ChatGPT-4 nailed it on the first try, with minimal code.
- Claude and Meta AI weren't far behind, just needed a small tweak (normalize pixel values).
- Gemini and Copilot... well, I'm super disappointed with their performance. Didn't manage to run the code at all, even after many prompts.
With Stardist-based segmentation, the code generated by ChatGPT, Claude, and Meta AI produced statistically identical results for the intensity measurements.
While AI is making rapid progress, the need for detailed prompting to obtain reliable results underscores the continued importance of domain expertise and basic coding skills.
Title:
340 - Comparing Top Large Language Models for Python Code Generation
Переглядів: 1 696

Відео

338 - Understanding the Benford's Law of Probability
Переглядів 1,2 тис.Місяць тому
Benford's Law, also known as the first-digit law, is a statistical phenomenon observed in many sets of numerical data. It states that in certain naturally occurring datasets, the leading digits (1, 2, 3, etc.) occur with a higher frequency than larger digits (4, 5, 6, etc.). According to Benford's Law, the distribution of leading digits follows a logarithmic pattern, where smaller digits are mo...
339 - Surrogate Optimization explained using simple python code
Переглядів 1,2 тис.Місяць тому
Surrogate optimization is a method used to solve optimization problems that are expensive or time-consuming to evaluate directly. It relies on constructing a surrogate model (also known as a metamodel) that approximates the objective function based on a limited number of evaluations. The surrogate model is then used to guide the search for the optimal solution. This approach is particularly use...
322 - PSO Using steel optimization
Переглядів 1,5 тис.2 місяці тому
Code link: github.com/bnsreenu/python_for_microscopists/blob/master/322_Optimizing_Steel_Strength_using_PSO.ipynb Finding the best alloy with maximum yield strength using Particle Swarm Optimization In this example, we will work with the steel alloy data set. Download from here: www.kaggle.com/datasets/fuarresvij/steel-test-data The data set contains the elemental composition of different alloy...
321 - What is Particle Swarm Optimization PSO?
Переглядів 2,4 тис.2 місяці тому
Code link: github.com/bnsreenu/python_for_microscopists/blob/master/321_what_is_particle_swarm_optimization.ipynb Particle Swarm Optimization PSO is a swarm intelligence algorithm that is inspired by the behavior of social organisms such as flocks of birds or schools of fish. The algorithm creates a population of particles, each representing a candidate solution, that move through the search sp...
320 - Understanding Simulated Annealing​ using steel optimization
Переглядів 1,4 тис.3 місяці тому
320 - Understanding Simulated Annealing​ using steel optimization Code link: github.com/bnsreenu/python_for_microscopists/blob/master/320_Optimizing_Steel_Strength_using_simulated_annealing.ipynb Finding the best alloy with maximum yield strength using simulated annealing algorithm In this example, we will work with the steel alloy data set. Download from here: www.kaggle.com/datasets/fuarresvi...
319 - What is Simulated Annealing Optimization​?
Переглядів 2,3 тис.3 місяці тому
319 - What is Simulated Annealing Optimization​? Code link: github.com/bnsreenu/python_for_microscopists/blob/master/319_what_is_simulated_annealing.ipynb Simulated annealing is inspired by the physical process of annealing, in which a material is gradually cooled to form a crystalline structure with a minimum energy state. ​ It works by iteratively adjusting the temperature of the system and a...
318 - Introduction to Metaheuristic Algorithms​
Переглядів 2,5 тис.4 місяці тому
Metaheuristic algorithms are optimization techniques that use iterative search strategies to explore the solution space and find optimal or near-optimal solutions.​ They do not guarantee finding the global optimum, but instead aim to efficiently explore the search space and converge to a good solution. ​ These algorithms use heuristic rules to guide the search and modify the solutions over iter...
317 - HyperParameter Optimization using Genetic algorithms
Переглядів 3,8 тис.4 місяці тому
Code generated in the video can be downloaded from here: github.com/bnsreenu/python_for_microscopists/blob/master/317_HyperParameter_Optimization_using_Genetic_algo.ipynb In this example, we will use the same dataset (steel alloy strength) from the previous tutorial to fit and tune Random Forest Regressor.​ The dataset can be downloaded from here: www.kaggle.com/datasets/fuarresvij/steel-test-d...
316 - Optimizing Steel Strength using Metaheuristic algorithms (e.g., Genetic)
Переглядів 2,3 тис.5 місяців тому
Code generated in the video can be downloaded from here: github.com/bnsreenu/python_for_microscopists/blob/master/316_Optimizing_Steel_Strength_using_Metaheuristic_algo.ipynb In this example, we will work with the steel alloy data set.​ Download from here: www.kaggle.com/datasets/fuarresvij/steel-test-data​ The data set contains the elemental composition of different alloys and their respective...
315 - Optimization using Genetic Algorithm
Переглядів 4 тис.5 місяців тому
Code generated in the video can be downloaded from here: github.com/bnsreenu/python_for_microscopists/blob/master/315_Optimization_using_Genetic_Algorithm_Heart_disease.ipynb The genetic algorithm is a stochastic method for function optimization inspired by the process of natural evolution - select parents to create children using the crossover and mutation processes.​ Coding it in python: The ...
314 - How to code the genetic algorithm in python?
Переглядів 7 тис.5 місяців тому
Code generated in the video can be downloaded from here: github.com/bnsreenu/python_for_microscopists/blob/master/314_How_to_code_the_genetic_algorithm_in_python.ipynb The genetic algorithm is a stochastic method for function optimization inspired by the process of natural evolution - select parents to create children using the crossover and mutation processes. The code is an implementation of ...
313 - Using genetic algorithms to simulate ​evolution
Переглядів 3,6 тис.6 місяців тому
Genetic algorithms simulate evolution and natural selection to produce adaptive traits.​ Camouflage is a common adaptation that helps animals blend into their environment and avoid predators.​ Insects can be represented as a string of genes that code for specific visual features such as color, shape, and texture.​ A fitness score is used to evaluate an individual's ability to blend in with thei...
Why GPUs Outpace CPUs?
Переглядів 2,4 тис.6 місяців тому
A Deep Dive into Why GPUs Outpace CPUs - A Hands-On Tutorial FLOPS is commonly used to quantify the computational power of processors and other computing devices. It is an important metric for tasks that involve complex mathematical calculations, such as scientific simulations, artificial intelligence and machine learning algorithms. FLOPS stands for "Floating Point Operations Per Second" which...
312 - What are genetic algorithms?
Переглядів 5 тис.6 місяців тому
Genetic Algorithms (GA) are a type of evolutionary algorithm inspired by the process of natural selection in biological evolution.​ They can be used to solve optimization problems, including finding the optimal values for various parameters.​ GAs involve creating a population of candidate solutions, which are then evolved through the application of selection, crossover, and mutation operators.​...
306 - Content based image retrieval​ via feature extraction in python
Переглядів 6 тис.7 місяців тому
306 - Content based image retrieval​ via feature extraction in python
Generative AI and Prompt Engineering for Marketers
Переглядів 2,7 тис.8 місяців тому
Generative AI and Prompt Engineering for Marketers
Exploring Metadata in Scientific Images
Переглядів 3 тис.8 місяців тому
Exploring Metadata in Scientific Images
337 - Whole Slide Image segmentation for nuclei​ using Detectron2 and YOLOv8
Переглядів 4,2 тис.8 місяців тому
337 - Whole Slide Image segmentation for nuclei​ using Detectron2 and YOLOv8
336 - Nuclei segmentation and analysis using Detectron2 & YOLOv8​
Переглядів 8 тис.9 місяців тому
336 - Nuclei segmentation and analysis using Detectron2 & YOLOv8​
334 - Training custom instance segmentation model using YOLO v8
Переглядів 23 тис.9 місяців тому
334 - Training custom instance segmentation model using YOLO v8
333 - An introduction to YOLO v8​
Переглядів 16 тис.10 місяців тому
333 - An introduction to YOLO v8​
Extracting a Targeted Subset from a COCO JSON annotated dataset
Переглядів 1,8 тис.10 місяців тому
Extracting a Targeted Subset from a COCO JSON annotated dataset
335 - Converting COCO JSON annotations to labeled mask images
Переглядів 11 тис.10 місяців тому
335 - Converting COCO JSON annotations to labeled mask images
Simplifying code with defaultdict in python
Переглядів 2,7 тис.10 місяців тому
Simplifying code with defaultdict in python
332 - All about image annotations​
Переглядів 15 тис.11 місяців тому
332 - All about image annotations​
A Holistic View of Software Languages, Databases, and Frameworks
Переглядів 1,9 тис.11 місяців тому
A Holistic View of Software Languages, Databases, and Frameworks
331 - Fine-tune Segment Anything Model (SAM) using custom data
Переглядів 50 тис.11 місяців тому
331 - Fine-tune Segment Anything Model (SAM) using custom data
330 - Fine tuning Detectron2 for instance segmentation using custom data
Переглядів 23 тис.11 місяців тому
330 - Fine tuning Detectron2 for instance segmentation using custom data
329 - What is Detectron2? An introduction.
Переглядів 16 тис.Рік тому
329 - What is Detectron2? An introduction.

КОМЕНТАРІ

  • @edomedo9137
    @edomedo9137 3 години тому

    this guy is so wholesome

  • @saeedakbari4714
    @saeedakbari4714 8 годин тому

    Thank you so much...fantastic

  • @mathematicswithharsh
    @mathematicswithharsh День тому

    Finally I Did it 😭😭😭😭 Guys, Idk what this code means, but you can use this code, I literally put my 4-5 hea in figuring it out with ChatGPT and all, but this finally worked for me 😭😭 Here is the Code, # -*- coding: utf-8 -*- """ Created on Mon Aug 19 20:04:49 2024 @author: User """ import numpy as np import imageio # Reading an image image = imageio.imread('Images/harshface.png') # Print the image array print(image) # Check if the image has an alpha channel if image.shape[2] == 4: # Remove the alpha channel image_rgb = image[:, :, :3] else: image_rgb = image # Apply a blue tint (ensure image is in float type for manipulation) image_tinted = image_rgb.astype(np.float32) * np.array([0., 0., 1.]) # Clip values to ensure they are in the valid range [0, 255] image_tinted = np.clip(image_tinted, 0, 255).astype(np.uint8) # Save the tinted image imageio.imsave('Images/harshface2_tinted.png', image_tinted) # harshface is the image I used haha

  • @RG-ik5kw
    @RG-ik5kw День тому

    Where do you define the eos_token and bos_token in the training text formatting? Also, what is the format of the dataset txt files?

  • @yslslyl622
    @yslslyl622 3 дні тому

    好好好

  • @gregoireworoniak8546
    @gregoireworoniak8546 3 дні тому

    Hello, tahak you so much for this video it actually helped me a lot. But I still have some questions about few things i still don't understand. Would that be possible to discuss it with you on twitter or something ? I just followed you there but i can't send you a message. If it's not possible for you no problem, thank you for this qualitive content anyway keep this way! Have a great day !

  • @meghaadikarinayake7067
    @meghaadikarinayake7067 3 дні тому

    Sir, I have 120 classes will this work in my case ?

  • @alejandraossajimenez858
    @alejandraossajimenez858 4 дні тому

    Thank you so much for your generosity sharing this knowledge and taking the time to create these well explained videos. I am currently doing a masters in AI and these videos are a great addition, some are even better, or at least easier for me to understand, than my course explanations.

  • @alejandraossajimenez858
    @alejandraossajimenez858 4 дні тому

    These videos are wonderful. I would like to add that there is a 4th paradigm which is: semi-supervised learning. :)

  • @mathematicswithharsh
    @mathematicswithharsh 4 дні тому

    Which software did you used?

  • @PriyaDas-he4te
    @PriyaDas-he4te 4 дні тому

    Hey! Your Videos are Amazing. Can you post some Videos On Diffusion.

  • @BhagyashriDhage
    @BhagyashriDhage 5 днів тому

    Perfect

  • @waddahalhajar
    @waddahalhajar 5 днів тому

    the validation data folder does not have segmentations ! , just 4 images

  • @yourgo8825
    @yourgo8825 5 днів тому

    great video, Now we are waiting for SAM2 using custom data

  • @meysamakbari6523
    @meysamakbari6523 5 днів тому

    Hello, I have set of images with size of about 1024x1024 but the size of object to be semantic segmented are big almost like 600x600. My dataset size is too low but not sure if patchify makes sense here?

  • @eliememel2680
    @eliememel2680 5 днів тому

    please what size of ram hae you for training this model ?

  • @nishat919
    @nishat919 6 днів тому

    I want to apply srgan method to my custom dataset in colab. I tried using your method but ram crashed everytime and I am not able to get a workable model. Can you please help regarding this matter please?

  • @kiit8337
    @kiit8337 7 днів тому

    Can i leave some of your videos especially biomedical application..while following whole playlist ?any suggestions

  • @kiit8337
    @kiit8337 7 днів тому

    Hey digiisreeniiii❤...do u think being a freshman in a collg i can study this whole playlist one by one want to learn ML 😊plz reply if u see it thnaks

  • @hemalathab9299
    @hemalathab9299 7 днів тому

    Save Images with annotations is now a paid feature in CVAT. Thus it is not totally free.

  • @anonymousgawd..3047
    @anonymousgawd..3047 7 днів тому

    Heloo srniiii am just a fresher with combinatorics and calculus knowldege can i understand whole of the playlist ....or is is only for microscopist ?

  • @aminparvizi5112
    @aminparvizi5112 8 днів тому

    Nice :)

  • @alin5163
    @alin5163 8 днів тому

    Thanks!

  • @ati43888
    @ati43888 10 днів тому

    Very nice

  • @pedar
    @pedar 10 днів тому

    thanks a lot man! great video

  • @danm7377
    @danm7377 12 днів тому

    Can you work on detecting Parkinson disease using spirals drawing? it's my first project, and I have a dataset of 260 images only. I am not sure if I do data augmnetation on diseased person only or on healthy to

  • @muhammadzeeshan9548
    @muhammadzeeshan9548 12 днів тому

    hi there love the content can you please do a video for panoptic segmentation using are own dataset and please make it from scratch meaning how we get the instance segmentation mask and the semantic segmentation mask then how we combine them and run it on own own dataset.

  • @kelixoderamirez
    @kelixoderamirez 13 днів тому

    permission to learn sir. thank you

  • @GradStudentTutorials
    @GradStudentTutorials 13 днів тому

    Amazing explanation! Thank you.

  • @mohamadmahdinafar7638
    @mohamadmahdinafar7638 13 днів тому

    great video.

  • @FunkyPeakz
    @FunkyPeakz 13 днів тому

    Any body intrested in my project.. im working on a density map estimatatin

  • @alin5163
    @alin5163 14 днів тому

    Thanks!

  • @zhengguanwang4337
    @zhengguanwang4337 14 днів тому

    After I use this Python code, the result of 0 hour is :The binary True value is 53829. the result of 2 hour of the same sample :The binary True value is 1363498. That makes no sense. I thinking the problem is because of sample 0 hour. The color of scratch area of 0 hour should be more green. I am just learn by myself and who can help me? or leave the E-mail address. Because with pictures, I can explain my question more clear. Thank you so much in advance.

  • @RaghavaIndra
    @RaghavaIndra 14 днів тому

    Best tutorial on ARIMA forcasting. Thank you.

  • @zahrajafari-i9x
    @zahrajafari-i9x 14 днів тому

    I have a question: Can we use label studio, for instance segmentation labeling?

    • @DigitalSreeni
      @DigitalSreeni 12 днів тому

      I haven't used it in a while but I sure hope it allows for instance segmentation labeling.

  • @World-Of-Mr-Motivater
    @World-Of-Mr-Motivater 14 днів тому

    sreeni can you give us the link for the q and a document ? it's not there in your github

  • @HiradAbedzadeh
    @HiradAbedzadeh 14 днів тому

    Thank you sir!

  • @eeeeeeeeeeef
    @eeeeeeeeeeef 15 днів тому

    Thank you for this! Very helpful when you go over basics once in a while

  • @NikalabhDihingia
    @NikalabhDihingia 15 днів тому

    Hi Sree, I am running into a problem with the code which gives me a an error when a load the dataset. Could you please help me with that?--- ValueError Traceback (most recent call last) <ipython-input-20-ee9fee6be012> in <cell line: 1>() ----> 1 example = train_dataset[0] 2 for k,v in example.items(): 3 print(k,v.shape) 6 frames /usr/local/lib/python3.10/dist-packages/transformers/image_utils.py in infer_channel_dimension_format(image, num_channels) 241 first_dim, last_dim = 1, 3 242 else: --> 243 raise ValueError(f"Unsupported number of image dimensions: {image.ndim}") 244 245 if image.shape[first_dim] in num_channels and image.shape[last_dim] in num_channels: ValueError: Unsupported number of image dimensions: 2

  • @staticrevo
    @staticrevo 16 днів тому

    What dataset are you using please

  • @user-df7wq9sv5v
    @user-df7wq9sv5v 17 днів тому

    Nice tutorial, but wouldn't using any resampling techniques before splitting the data cause data leakage therefor biased performance measurement on evaluation data ?

    • @DigitalSreeni
      @DigitalSreeni 12 днів тому

      Yes, you are right. You need to do that after splitting. I wasn't very mindful of such details in my earlier videos. I guess I should re-record videos on certain topics.

  • @prita-2021
    @prita-2021 17 днів тому

    Hey hi, lov your work .could plz explain how we could annotate SAR sentinel 1 images

  • @helloindia6748
    @helloindia6748 19 днів тому

    Thankyou sir !! It was quite helpful

  • @TheReactorFYP
    @TheReactorFYP 19 днів тому

    All fun and games until something made appears behind you

  • @pranavpalaniappan3816
    @pranavpalaniappan3816 19 днів тому

    I usually do not comment on videos but had to for this one. Wonderfully explained with step-by-step instructions. Thank you!

  • @macarronewitchis
    @macarronewitchis 20 днів тому

    Thanks for the video! I am getting the error "ValueError: Unsupported number of image dimensions: 2" in the SAMDataset, and I am strugling to fix it. Anyone with similar error?

    • @DigitalSreeni
      @DigitalSreeni 20 днів тому

      I guess you are working a gray image and SAM expects a color image with 3 channels. If this is the case, you can copy your array twice to create an array with shape (x, y, 3) instead of just (x,y).

    • @macarronewitchis
      @macarronewitchis 19 днів тому

      @@DigitalSreeni That was exactly the problem, thank you!

  • @DigitalSreeni
    @DigitalSreeni 20 днів тому

    For those who aren't patient enough to watch the whole 38-minute video, you can jump to the last 10 minutes where I tweaked my original prompt to use deep learning for segmentation and ran the experiment again.

  • @tilkesh
    @tilkesh 20 днів тому

    Thank you very much.

  • @tektronix475
    @tektronix475 20 днів тому

    prety useful, thanks!

  • @wertzaky29
    @wertzaky29 20 днів тому

    37:14 is the conclusion. Ur welcome