Introduction to Federated Learning | DataHour | Analytics Vidhya

Analytics Vidhya · Beginner ·📰 AI News & Updates ·3y ago

Key Takeaways

This video introduces the concept of federated learning, its importance in maintaining data privacy, and its applications in various fields such as healthcare, education, and finance. It also covers the basics of federated learning algorithms, including federated average and federated proximal gradient.

Full Transcript

foreign good afternoon good morning I'm Tejas I work currently as a senior TPM and I have been into data science since 2012 13 onwards um my usual work is around a natural language processing forecasting and I have been working in Consultants role as well as an individual capacity both of them in my current work what we have today is a session called Federated learning it's right now more into research than the applied part and with the help of all of us who have joined the session maybe if we start using this it would become more mainstream right now so uh I'll just walk through the session so basically right now we have seen quite a few growth in machine learning Technologies which are empowering quite a few artificial intelligence softwares and applications into areas of computer Visions speech recognitions natural numbers processing and you know recommendations engine everywhere so basically either use Google analytics or Google Bots Amazon Eco Amazon website Flipkart everywhere artificial intelligence espresso even if you you know cars like Tesla who have automation or accidental detection system even in the new Apple watch there is an experimental system which kind of printed as an SOS in case they think there was an accident so all the system basically use uh in AI or machine learning algorithm at the end of it right and all this work best based on the data or quality of data that they receive and why this has been you know uh being driven in the last 10 to 12 years due to the emergence of a large amount of processing CPUs that are available to local public as well as Big Data technology systems that have come up which can allow you to process and gather a large amount of data transform and you know use it into an aggregation or a real-time form of it now modern society uh after the emergence right they kind of became aware about this data being used and then when something new comes up there are abusers who also come into the picture uh so they started looking at data and if the systems were not good enough protected the data started becoming public uh government took notice of all this and now has started to put in places where they can control the data of how it is being used what they are being used for who owns the data those kind of questions have come up so there are government introduced forms like gdpr and all that which can now if not being you know can hamper AI if we don't kind of react to this new era of how the data is being used uh what do we mean by all this that you know how this data is being used so if you see right now Amazon or Flipkart website uh have you browsed the data have the billing information or which products do you buy what keywords do you use uh what is your purchase history uh what has favorited or whatever you have put it into your wish list all this data basically gets used into a recommendation system then which gets aggregated and used as in form of a metadata for others users to recommend product to them or showcase the order of the products or which product basically they want to purchase or which vendor they want to work more closely with so all this kind of magic happens to the data and if data is not then it would not happen now all this uh seems still okay in the sense that metadata being used in form where you are just purchasing which is kind of similar when you go to a shop other peoples can look at it and get informed decisions based on that but what happens if similarly medical data is being used or medical data gets out of hand or somebody gets hold of your private informations so that is where the regulations like gdpr have been you know making sure that pii PCI Data does not get out hospitals are able to lock in their data into their local system they are not able to share or even the financial data like your credit scores your purchase history your ATM transactions do not go out of their particular vpns or local networks now because of this this uh how do you you know without data you can't go into much or improve your artificial intelligence of this or ml so there was a thought process like what can we do to make sure that data still can stay local and we can get benefit out of it at that time uh there was a new technology which was coming up like blockchain and so people thought of let's merge both blockchain and uh Ai and create something that is mostly what we have called as Federated learning right now we'll go to the next slide so initially when this distributed computing system or thought of having data only on the edge devices came into picture uh this was the first uh pass that people took at it they made sure that all the age devices like gpus or CPUs stay within the boundary of region it made a state boundary or Nation boundary or a region boundary and then models get trained on that particular data uh they create gradients and those gradients are basically sent to a central server they're based on the gradients received from different Edge devices they get aggregated into system a new aggregated gradients come up and they basically get again shared to the Edge devices and this uh we solve a bit of problem of our data because now it's being stored in the local devices or Edge devices they are not getting stored however we are still sharing gradients out of it right so somebody can be malicious and trap the gradients and understand what kind of data that we are sharing so it was a good system to start off with but it still had its flows so how do we improve this uh so a new paradigm was thought that instead let's have the models only being discussed or distributed between the network rather than any of the data so now in the H devices models are being stored trained and kept and whatever weights that we have from the different models that only get aggregated into the central server so now even if somebody is able to capture your weightage it does not make any sense because without the model itself makes make no sense and now your data also stays local so there is very less chance of any private data or private information getting shared what it also allows you to do is that the computation power of your Edge devices can be utilized to train your model so we have seen in recent time we have better working mobile devices our watches tablets all have you know highest capacity seat new chips so basically they can train model and keep updating in and only your basic server takes up the aggregation part of it and create a model out of it so it saves on that network capacity as issue as well which was there in the distributed system so just to take a summary of what we discussed is uh when we discuss about Frederick learning there were two approaches that the systems work with one was the distributed one was the Frederick the limitation of the network issue or the data loss was kind of an overcome by uh making sure that only weights get distributed but it again failed the system with uh data heterogeneity issue or system heterogeneity what do we mean by system and data heterogeneity is let's say a client or an end user only performs same kind of work or a very less data let's say take an example of a supermarket your Edge devices have what they have in Australia might not be similar what they have in U.S or in Indian Supermarket so that kind of creates an issue because you can't directly share data between them or the models between them and they can create some bias in the modeling stuff itself so this were kind of all theoretical approaches that we had till now uh let me take a pause here and see if there are any questions so gradient what do we mean is basically uh so instead of model we are now sharing all the parameters like uh what columns that we are using what kind of uh weightage that's we have with those and what is their importance of in the model itself so those kind of information again becomes an issue right because now we know that let's say let's take an example of user Behavior data so we say that age replace those kind of variables become more important in your data that gets shared over the time so somebody can you know understand that when when you are trying to shop something what are your preference preferred factors that you look at so basically that kind of creates an issue okay I see another question from anirban gbrp is a European uh I think there is a type of gdpr should be there uh so basically it's a European uh regulation that allows uh data sharing between different systems how to stop it yeah we have gdpr only on the first slide another one uh it's a role uh like how we have in India that we cannot share data of aadhar card and it gets XXX when we kind of share it with numbers so similarly Europe has very strict Norms on what gets stored in your cookies and what information that can be scrapped from website what information can be shared between countries like that so gdpr is that law that allows you to understand what kind of data privacy security that we have uh next question we have is from Ram uh similar to multitask yes that's definitely the same uh it's similar to how our application logic that we write nowadays right that we have different servers that we place in one in Europe and in U.S one in Australia and like that and that particular regions user Only log into that particular system and kind of share data with them so it's on the similar architecture where we have GPU machines located in different parts and distributed on their data goes to those GPU systems [Applause] let me look at the check as well I will uh we have a question from Naveen how it relates to Tiny ml to cooperate MLB so there is no uh stoppage of whether it can be only deep learning algorithms or a simple machine learning Alternatives based on the computation power that we have and the amount of time the system is available we can use it so once we go in the forward right there are different aggregations it is that we use in preparated learning that will kind of explain more of how we can kind of use it or what type of algorithms we can use it all right I think we have cleared all the questions and queries till now we'll move to collection one second all right so now uh we talked about um the different kind of algorithms or uh what aggregation method basically gets being used uh by this Federal algorithm right because that becomes your single point of failure if your aggregation method or evaluation kind of has any bias into it the complete model system fails because now everybody will be used with that bias so what we have right now is basically four strategies that are available or kind of quite famous or available strategies first is Federated average what they try to do is that they understand that all of the clients are on the same level and whatever data or weights they are sharing basically back to us is of similar importance and we kind of look at that and uh what our aim is to basically reduce the loss that are happening at a local level and then thus we have an overall less loss at the global level so it's the most simplest method that kind of being used right now and it can work in a less complicated system where you are just starting off with the Federated learning what was happening in this one is that uh what happens if your most of the devices are very slow or they do not have enough juice so what will Fender to the average will do is they'll try to drop system because there is a cycle that they have to follow and because they look at all of their devices to provide input if within certain range if you are not able to do it they'll kind of start dropping you out but let's say in worst case scenario or 80 to 90 percent of devices are very slow then basically you have no input data right your machine now has become very biased or it is having issues with the data that they are only looking at 10 percent of your possible [Music] complete uh population and rather than then you're trying to create a model which will work for a larger system so that's why uh Frederick proximate system was used what it was allowing is that if there are any larger changes in the data set that is happening right because if they are saying the model changes very large then they'll try to penalize them so basically why it was really what it was reduced is that now if there is heterogeneous endangered data then it becomes faster to converge uh again but this also has an issue because now let's say if you have similar type of data everywhere then this model will not work because now everybody is on the same plan similar data there will be not many large changes so there is no penalizing of anybody it will still keep going in the same manner so that's why uh Q Federal average model was introduced which kind of tried to combine best of both the strategies that we had Federate average and better proximity what it used to do was that instead of uh you know giving any penalization or anything it's what I tried to do was whoever was giving you more data try to give preference to that and kind of assuming that it resumes more of a population we will try to become more nearer to that so that was one of the strategies that was being done uh it also kind of allows to be more fairer across the board so models now become uh with similar to a population or a larger you know that they are trying to be in the same range rather than you know having any uh differentiation being input into the system so on overall your models will become start performing better uh on an average device but let's say there was some outlier cases it will not take into action into those so that's why a new strategy was combined because let's say you you are having a car system which is uh very new to a country and your partial data models were in U.S so your Indian inputs or anything would be just overwritten by all this strategies that we discussed so let's say how do you prioritize this kind of data as well or your own data as well so let's say somebody bought an iPhone from us and they have come to India there are not many users in India so whenever he types into his local language Hindi in kannada or anything and the recommendation system will still give him inputs from us right because that's the language the model was trained on it becomes very cumbersome for the user so a new strategy was developed which was called personal Federated average what I try to do is it try to give importance to the local model itself rather than a local data itself rather than getting more from a aggregated model system that the are getting it will keep just giving preference to the local inputs or local data that the system is producing what it will do is after two or three iterations of the global weights that they come in it will start ignoring that and it will give start giving prioritization to the local so your model still will be more or less on par with the global parameters but always hypertuned with your internal data that you are trying to gather so it will always give you best result for your own rather than you know a larger population or a larger area that tries to cover so let's say there are 10 people using the same model into 10 different places in City they will have their own 10 different recommendation systems going on in parallel this is to something maml approach in meta learning if you have seen model agnostic meta learning let me look at any questions or queries that we have okay uh there is a question from farzana will there more be latency so latency will be more when we had basically data moving between system and distributed system there is a higher latency when there are weights only more thing so basically models only moving in between the latency becomes lower because then you can zip it and kind of share it across plus you don't need to you know refresh it multiple times you can have a fixed time that you can visit even when we are using system right we can Define system that how the sampling happens when everybody's data will be shared a good that everybody will be contributing or not like that so those kind of things we have to take care when we are doing the client server relationship between Apple and it kind of tries how the latency work uh next question is from Naveen please explain how Federal learning can contribute in terms of reducing the Infinity cost so now what we are trying to do is basically rather than running anything on the single server what happens right now we try to run the model on the edge devices so let's say you have any juice or maximum juice that we have on the end Edge systems right that we are trying to use and as you have local data is also very less it becomes faster than is able to you know try to reach the optimal Point faster right now if you see right any deep learning algorithm that you want to run for example a image classifier right so you get image from all the cameras from the city for one day and then try to run it will take at least four five six hours to run it because what is now happening is there is a central system where the complete base data has been gathered in it has to go through all those lacks and crores of pictures that are there and then kind of gets out let's say if the same model was running on each camera then it would kind of distribute the work right like they might have captured thousands of images but it's kind of content of the scale of what will happen at the centralized server so kind of it becomes faster okay and thus reduces the infrastructure cost so you don't need now uh Titan class or E3 class of GPU machines to run your models uh a similar simpler version can you know do it even CPUs in case let's say your amount of data gathered is lost so that's how you save money on infrastructure okay so now there is uh Ravi Kumar is asking when I spoke to the ml models in each devices you can convert the model to Iranians yeah uh so there are quite a few devices which are support so one of the so I have in this slide we are going through the different Frameworks that are right on supporting this and I'll take an example of flower which is an agnostic common mode framework that we can use and it supports quite a few devices and very famous with iot devices as of now we'll go through that all right uh please how can we use Federated learning in NLP especially in sentient analysis so say uh so we have all used Google keyboard right a Google keyboard is an excellent example of Federated learning system which was like a Google web Pioneer of using it and they are using right now so sentiment analysis can be part of that service which gets called whenever somebody is writing any messages regardless of which service they are using and that service running in background can give you sentiments in the real time so now the sentiments are for tuned for that particular local language or the region and now can be in more tune with um What that particular word or a dialect means so this is how the Federated learning can help you in this Edge device usage foreign so right now what research or Frameworks are being available uh so majority of research right now is happening in encryption transfer learning um adversarial Network usage differential Services how we can you know incorporate more into this modeling I have kept the link here called uh awesome Federated learning it basically has all the papers ranked and based on where they are which category they belong to so it's a good resource to go through that uh for any understanding that you want to increase for the Federated learning part there are three major Frameworks which support Federated learning first is tensorflow by Google then we have pytorch and bicep and then there is something called as flower right now tensorflow is having some issue that you have to use either the GCE image or you have to do it on your own infrastructure the Google collab is not in tune with tensorflow because Google prolab is running on python 3.7 whereas tensorflow requires python 3.9 support for your latest library to run so it's kind of issue as of now what I'll try to give you an example is using flower with pytors to Showcase a simple example of image classification there are also let's say if you want to do your private research there is this site uh leaf dot c new which kind of gives you data which you can use for your personal uh research or getting more understanding of the data so you can use this data set it's free of charge available now uh just a few assumptions that I have made to create the demo I have made sure that all devices are taking part there is no sampling that I'm doing right now synchronization is happening uniformly because this all can be in real time when you create an application you have to take care of and what I'm again assuming is that uh whenever a training or modeling happens it happens during the you know downtime or when there is no CPU requirement so basically systems are all available when I'm running the model so these are my three assumptions that I have taken uh again as I mentioned this can be done using deep learning or machine learning any of the algorithms right now I'll create an example with deep learning to show the image classification this is the algorithm that we'll be using it's a flower it's contributed by CMU and uh right now if you see it's being used by Samsung Nokia so they are more on to iot devices uh where this being used and it supports basically a very large Gator of uh you know AWS gcp so Android iOS raspberry basically you say what you want and all of those devices can you know use this flower to run their modelings okay any queries or questions let's see and then we'll start with the demo all right okay I'll share this Jupiter notebook with you guys it's a simple notebook now first step what basically I'm trying to do is install flower uh torch torch Vision Network clip just for the you know image if you want to showcase the grid and all that these are some of the packages and libraries that I am trying to import majority of is that we'll be using in this demo is C part 10 so I have just imported the data set um here uh the note is I am right now using CPU because I'm using the free version of the Google in case you are on the paid version or if you're able to get sufficient gpus just change it to q.0 it will kind of allow you to use gpus but right now I'm using CPU so that's what uh this basically showcases what libraries and packages that we have and what versions they are using uh as you know right in c510 basically there are 10 different classes of images playing bird cat Etc and will try to kind of classify it using penetrated learning uh I have taken 10 clients uh for this example so basically what we'll do is that assuming that there are 10 devices will be contributing to the system and trying to run models in this is basically a simple data set proportion so whatever data that we have in C for 10 I'll kind of convert it into 10 different partitions this partitions are not being done either using any methods for sampling or anything I'm just doing a natural partnership question uh natural partition based on size but let's say if you want to be more real image or you know more that real-time scenarios you can use those differentiation algorithms to kind of create more mixer or not hemogeneous data and kind of try to play around with it how the Federated learning model Works in that case what this natural flow allows us to do is we have in each of the 10 partitions some good grouping of different kind of categories all right um as we said we will have 10 time test and valid except because now we have 10 clients this is a sample of as I mentioned right we have good grouping of all the categories in one group again the samples can be done it in like on one client can only give trucks one client only gives you cats this is like you know the data we can kind of do differentiation and see how a federal learning works with that but again um for this tutorial I'm just doing a simpler version of it all right so first what we'll do is we'll do the classical example of how it happens right now so I have done a CNN algorithm that I have created so basically what it does is we have two layers one convolution layer then cooling layer then another conversion layer and then linear layers which will make sure that our image is kind of get classified I'm using relief uh for all purposes I have used Adam for our physically uh I think you guys are aware right it's like the most advanced version that we have right now for optimization and it kind of works faster than any other method so uh that that's what I'm kind of using as of now this will kind of give us uh at each image what was the loss and then kind of come to a solution on the categorization so when I ran it for 10 epochs basically my accuracy figure was somewhere around 47 again if we increase number of epochs will get better but for this tutorial 10 should be good enough now we'll start with the main Federated learning so for any Federated learning right as we had discussed we have to set parameters so for any client we have to create we'll have get set fit and evaluate as these three methods that we'll do uh so that is what we have to find with the client with get parameters fit and evaluate so basically whenever we kind of we create parameters that get set into the models and if let's say they want to get a fetch parameters from the central server we have a method for that as well now this is just setting up we want to have 10 different uh clients so I'm just giving them all a different ID based on string and creating different devices just to simulate the server foreign sorry um so flower does not give out of the box uh aggregated parameters like how we had in CNN right that you know gets you from 10 different training examples they kind of get you an aggregated version of your accuracy so what I've done is I've written a simple function which will work uh all right like which will act like custom metrics and give me error numbers and how my accuracy is so I have defined that in weighted average function now this is my strategy I'm using federative average for my optimization what I have mentioned is that minimum of five and maximum of 10 clients we have this uh will have all of our 10 lines work in it but this basically works that if let's say some uh clients are not available or they are out of bound or out of range or they are basically something activity so what we are saying is at least five should be there to start the training and I have mentioned that uh the function just figured it as a custom metric I am saying let's run 10 drums because we had 10 epochs so I just want to showcase uh you know Apple to ample comparison so I'm just having 10 grams of Federated learning as well foreign this takes about uh you know quite a few times so it took me about uh 460 seconds so that's why I had run it just before our session and the accuracy figures that I got was after 10 long was about 49 so at least about two percent better than what we had but that's okay um similar range but now what had happened was everything happened on the system and we didn't have a centralized system that was being so data stayed and kind of if you see here it started with 0.6 and trying to keep getting better after each round and just to see the output of it I have one output printed so first is cat shape shape shape a plane frog so kind of good enough with this small setback we had and small amount of you know rounds of testing that we did I'll stop here for any questions that we have so now let's say anybody wants to start working on this right what should be the pitfalls or what should they be aware about one of the problem that we have is hi how many numbers of edge devices that are participating uh let's say if it's like a Google Android device they'll be in the range of hundreds of millions right but let's say if you are a very new startup that you are starting towards so it will be like one two three devices then in that case do you even want to go for this kind of iterated learning right because then it's circular problem that you can do it at a centralized location so that is something that to look at when trying to make a decision whether a Federated learning or a central approach that you want to do next is a distribution of data uh basically how much data a particular Edge device is kind of trying to you know give it to you because that kind of can create a bias when you are doing an average or aggregation of models uh again um so the idea is to have everybody you know give in to the system at the same time now what some of the companies have started doing is that they've tried to monetize the amount of data a user contributes so that is something that an approach can be looked at uh when trying to overcome this Pitfall uh next one is Network bandwidth and latency so let's say your devices stay in a very remote area like a hilly area or in jungles you'll get data after every three four days when they come into good practice or a satellite comes into that area so in that cases how do you take make sure that the models get updated properly and you know what should be the optimal purpose of sending that do you use cues did you use Kafka so all that also comes into picture when you're doing those kind of devices so those use cases have to be very specific when you are trying to do it and might require a more customized approach than a simpler algorithm that we can kind of use from either tensorflow or by Tosh where it's kind of actively being worked upon is healthcare because of uh the U.S Healthcare right now if you see right quite a few hospitals have data issues that they can't share data across the network or they are having an Statewide data regulations or federal regulations so this is something where Federated learning can work great we can have it on their laptops and tablets installed and everything remains within there however the whole uh Healthcare modeling kind of gets upgraded so that is something that is being looked at another is education um because if you see right mostly uh we have a central board system that happens but Statewide the results vary a lot so is there something that we can look at from the behavioral point of view of students if we can have models something like that so that is something that can be looked at financial sector Smart City put in for examples more and more iot devices that we kind of get Federated learning can help us with the data privacy data ownership as well as data monetization in those areas like if people can you know be paid to create data for you so that is something that can be looked at uh so I think we are on track we have 15 minutes left for any queries questions that we can have yeah there are some questions in the chat uh can you please answer that sure all right I'll start from the bottom uh Ashish can you recommend some books and tutorials so right now uh there are quite a um so this is more of a research topic right now so there are very less amount of books available um I'll try to share um not I don't have it right now but I'll add a PPT with the number of books that I have gone through or I have read in the past and I think you know can help you guys but there is no recent book that has come in last book I think was which had come in was in 2021 on Federated learning uh can you recommend some fact yeah so papers I already listed a link uh this is uh the awesome page it has all the latest papers again categorized by year and all that we can look at this is a good source to start off with for learning Federated learning I think we covered all the questions anything else folks please write down or okay uh what is the key link yeah not book link I'll share in the PPT it will I think shared by analytics with your team after the call I'll add the link there as well it will be downloadable what are the key limitations of iterated learning which is blocking its wide industry adoption uh the major area is the complexity of the devices right um it one solution will not work plus uh there is always an issue of bandwidth right now right so even if people are willing to share data or uh if there is any millise event uh interviews right like the system gets hacked uh then the data get generated is like a hectata how do you kind of differentiate between it so those are the reasons that it cannot be shared in open source right now or more generic view it's more closely work with devices as well as Network you have more control of like the devices that are being given in offices or hospitals so those are you know regularly checked for Securities malware uses all that so it's mostly used on those places right now or cars where you know it's without that particular device nobody can update the code that's why the Central Public usage is less whereas the recommendation system and all that kind of you know everybody can be used it does not matter much so those become very faster into the mainstream but this takes a bit of time [Music] one question was my research is about computer vision and sports can I Implement that learning if yes how can we briefly explain okay um so one of the view that happens what what use case I had understood when I worked on similarly in sports analytics was that let's say in football that you want to understand who has what are you kind of generate transcripts of it how much time a particular player had the ball with him or her and whom they passed was it a good pass or a bad pass those kind of you know metrics that they have done so what it required was that the specific Hardware to be placed around so instead maybe we can use a lower level Hardwares but have models running multiple times on them that can kind of solve problems because now you don't in high tech lenses or systems running on that kind of saves some cost on that so that is one of the use case that I can see we can use it for a fast-based system where you know instead of having high costly cameras systems we can use lower cameras but have better models across [Music] Ashish I took the question I'll add the books but papers are already there in this PPT you can have a look at it not sure about the drug Discovery however uh one of the use case that I worked off was about the in the you know image classification basically if you want to you get a lot of x-ray images or pathological slides that they have and having those shared across if you have a good model they don't need to spend that much time they get benefit of somebody of a larger organization or larger Hospital which has produced more data and has more variation of the data they those models can be used for us Hospital which is on a smaller scale where you know there is more Super data but their model now become more accurate with the help of others so that was one of the use case that I worked off in Federated learning foreign mostly uh not at the end user but more of that hospital so if we are thinking from that perspective that we look at all the OPD cases that come into a system and try to create a pattern out of it then yes we can use a Federated learning and because now local scenarios or local weather can also factor in um but if we are trying to get it from a person's data I think it would be a bit difficult right now not we have not reached that part how do you see better learning so Federated learning basically uh took half the learning from web3 right because that's what we have you have iot devices and everything that we have at the end user and try to make sure that model is also run there so it kind of gets more localized to you uh specifically as a user and you get more benefit out of it to your use cases so I think always the three and Federate learning will go hand in hand I saw one question in between now if one of the edge device is delayed to send the weights in uh FL to centralizer or what will happen so basically as I mentioned right I took an assumption that all 10 devices send everything at a time this will never be the case in the real time right there will be some will be sending it the later some will be sending it before again so what usually happens is uh we take sample of it that out of the population on is going so this uh certain devices will send in data and so on so there's the other section of the data will be shared so what happens is that the system is created in such a way that whenever there is a downstream expected from it right so uh let's say weekends in India are Sundays but in UI it's Friday right so we try to create system like that that data comes from those regions or cities based on that right it's all again in the customization when you create the final system you have to take in uh and create it like that and let's say in a larger scheme of pictures you have thousands of devices if 10 or 15 don't come in does not make much difference but let's say if your system is about 100 or 50 and then 10 does not come in then it's hit to your system or a model basically so depends upon that as well the scale of the system yeah I think we are good any questions please feel free to add it into the chat or q a and I can answer it foreign yeah so there is no difference right if you see here um so happen right now happens in a centralized server is right you upload your you create a model you convert it into a pickle or you zip it and then kind of deploy it on the server as a you know either as a web service or you have the model itself sitting there now but here what what has happened is uh basically the model itself is on the client side right the same way which how we did it uh so each equal uh it's sitting on the system and then it's just uh running it rather than a web service where a centralized system gets called every time when they want to test something so instead of that the model itself is sitting there it's like you're running your code on the local system right you have the complete model with you there is no calling anybody so that's the major difference between we have so when you have either a web service that kind of answers which is like a centralized approach but here uh all your data goes into your local machine your local there is no centralized thing where you get called or do anything so that's the major difference that you have and again how it gets pushed is uh when the basic of the device gets created or you can push it through the web service at the start they have you update the system or Os or updates that happen usually so that's how you get pushed so it Still Remains same just the calling happens differently instead of calling a central service now you are you know calling model locally now this will be similar to how you push your app updates right it's on the same track so you can take an example of it like uh your current system let's say it supports English in the Gujarati your keyboard was supporting those three languages now a new language kind of comes up like French or anything and now the support has been pushed in right it's on the same approach uh that new feature will be pushed in it will be a larger update than the usual but the same approach happens whenever a new feature gets pushed to your Android device or an iOS device as of now what's the minimum computing power cyan again it depends upon the system that you want or what is the complexity of the model that you have um even right now we have the Arduino boards and all that right raspberry buys they are quite very powerful to be very Frank so if you go 10 15 years back our computer system was not that powerful what are mobile devices right now so I think we are good from that side but let's say uh you have uh iot devices like measuring temperature or just you know doing one single task they might not be able to do everything uh typical device can do or a whole model it can run but if you are even able to get it like a Pentium one kind of stuff it's good enough to run a model thank you bye [Music]

Original Description

In this DataHour, Tejas will teach the basic concept of federated learning, the algorithm/library that supports the development in this area, and go over a simple example of a model created using this technique. This session can be used as a launchpad for aspirants to learn the basics and then become more proficient in the area. Do subscribe to Analytics Vidhya channel & get regular updates on videos: Stay on top of your industry by interacting with us on our social channels: Follow us on Instagram: https://www.instagram.com/analytics_vidhya/ Like us on Facebook: https://www.facebook.com/AnalyticsVidhya/ Follow us on Twitter: https://twitter.com/AnalyticsVidhya Follow us on LinkedIn:https://www.linkedin.com/company/analytics-vidhya
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Analytics Vidhya · Analytics Vidhya · 55 of 60

1 The DataHour: Data Science in Retail
The DataHour: Data Science in Retail
Analytics Vidhya
2 The DataHour: Anomaly detection using NLP and Predictive Modeling
The DataHour: Anomaly detection using NLP and Predictive Modeling
Analytics Vidhya
3 The DataHour: Energy Data Science Project from Scratch
The DataHour: Energy Data Science Project from Scratch
Analytics Vidhya
4 The DataHour: Explainable AI Need and Implementation
The DataHour: Explainable AI Need and Implementation
Analytics Vidhya
5 The DataHour: Google Cloud AI/ML
The DataHour: Google Cloud AI/ML
Analytics Vidhya
6 Prediction to Production in Machine Learning #machinelearning #prediction
Prediction to Production in Machine Learning #machinelearning #prediction
Analytics Vidhya
7 Practical Applications of Data science in Ecommerce
Practical Applications of Data science in Ecommerce
Analytics Vidhya
8 How to tackle Overfitting?#machinelearning #overfitting
How to tackle Overfitting?#machinelearning #overfitting
Analytics Vidhya
9 Building Data Pipelines on GCP #googlecloud #datapipelines #data
Building Data Pipelines on GCP #googlecloud #datapipelines #data
Analytics Vidhya
10 Hands-on with A/B Testing #abtesting #datascience
Hands-on with A/B Testing #abtesting #datascience
Analytics Vidhya
11 Efficient Implementations of Transformers #transformers #cnn  #machinelearning
Efficient Implementations of Transformers #transformers #cnn #machinelearning
Analytics Vidhya
12 Modern Deep Learning Architecture #deeplearning  #architecture #deeplearningtutorial
Modern Deep Learning Architecture #deeplearning #architecture #deeplearningtutorial
Analytics Vidhya
13 Key steps for Designing Artificial Neural Network (ANN) for Image classification #machinelearning
Key steps for Designing Artificial Neural Network (ANN) for Image classification #machinelearning
Analytics Vidhya
14 5 things you should know about Azure SQL #azure #sql #datahour #datascience
5 things you should know about Azure SQL #azure #sql #datahour #datascience
Analytics Vidhya
15 AI & ML in the Automotive Industry #machinelearning #ai
AI & ML in the Automotive Industry #machinelearning #ai
Analytics Vidhya
16 Building Machine Learning Models in BigQuery
Building Machine Learning Models in BigQuery
Analytics Vidhya
17 NLP aspects in Telecommunication Industry
NLP aspects in Telecommunication Industry
Analytics Vidhya
18 Practical Time Series Analysis
Practical Time Series Analysis
Analytics Vidhya
19 Fundamentals of Quantum Computing
Fundamentals of Quantum Computing
Analytics Vidhya
20 A DAY IN THE LIFE of a Data Scientist (From waking up to working on algorithms)
A DAY IN THE LIFE of a Data Scientist (From waking up to working on algorithms)
Analytics Vidhya
21 Classification Machine Learning Model from Scratch
Classification Machine Learning Model from Scratch
Analytics Vidhya
22 Knowledge Graph Solutions using Neo4j
Knowledge Graph Solutions using Neo4j
Analytics Vidhya
23 Model Guesstimation (MLOps)
Model Guesstimation (MLOps)
Analytics Vidhya
24 ETL Pipelines in Google Cloud Platform
ETL Pipelines in Google Cloud Platform
Analytics Vidhya
25 Key steps for Designing Convolutional Neural Network(CNN) for Image Classification
Key steps for Designing Convolutional Neural Network(CNN) for Image Classification
Analytics Vidhya
26 Getting Started with AWS EC2 #amazon #aws
Getting Started with AWS EC2 #amazon #aws
Analytics Vidhya
27 How to Use Azure NLP and Graph Databases for Intelligent Knowledge Mining
How to Use Azure NLP and Graph Databases for Intelligent Knowledge Mining
Analytics Vidhya
28 Certified AI & ML BlackBelt Plus Program #shorts
Certified AI & ML BlackBelt Plus Program #shorts
Analytics Vidhya
29 Visualizing Data using Python #machinelearning #visualization #python
Visualizing Data using Python #machinelearning #visualization #python
Analytics Vidhya
30 DCNN for Machine RUL Prediction using Time-series Data #timeseries #machinelearning #datascience
DCNN for Machine RUL Prediction using Time-series Data #timeseries #machinelearning #datascience
Analytics Vidhya
31 M in ML stands for Math & Magic
M in ML stands for Math & Magic
Analytics Vidhya
32 An Unsupervised ML approach using Clustering
An Unsupervised ML approach using Clustering
Analytics Vidhya
33 Customizing Large Language Models GPT3 for Real-life Use Cases #gpt3 #datascience
Customizing Large Language Models GPT3 for Real-life Use Cases #gpt3 #datascience
Analytics Vidhya
34 Model Parameters vs Hyperparameters - Techniques in ML Engineering #machinelearning
Model Parameters vs Hyperparameters - Techniques in ML Engineering #machinelearning
Analytics Vidhya
35 Practical MLOps #mlops #datascience
Practical MLOps #mlops #datascience
Analytics Vidhya
36 Data Engineering with Databricks #dataengineering #databricks
Data Engineering with Databricks #dataengineering #databricks
Analytics Vidhya
37 Multi-Objective Optimisation
Multi-Objective Optimisation
Analytics Vidhya
38 When Airflow Meets Kubernetes
When Airflow Meets Kubernetes
Analytics Vidhya
39 AI in Banking
AI in Banking
Analytics Vidhya
40 Learn Convolutional Neural Network for Image Recognition
Learn Convolutional Neural Network for Image Recognition
Analytics Vidhya
41 Extracting Value from Data
Extracting Value from Data
Analytics Vidhya
42 How to measure Marketing Channel Effectiveness
How to measure Marketing Channel Effectiveness
Analytics Vidhya
43 Transforming Lives | Data Science Immersive Bootcamp
Transforming Lives | Data Science Immersive Bootcamp
Analytics Vidhya
44 Stock Market Analysis - AI driven approach
Stock Market Analysis - AI driven approach
Analytics Vidhya
45 Become a Data Engineering Professional in 2022 | Future Trends + Skills Required
Become a Data Engineering Professional in 2022 | Future Trends + Skills Required
Analytics Vidhya
46 Ensemble Techniques in Machine Learning #machinelearning #ensemble #datascience
Ensemble Techniques in Machine Learning #machinelearning #ensemble #datascience
Analytics Vidhya
47 The Power of Visualization | Tableau Full Course | Analytics Vidhya
The Power of Visualization | Tableau Full Course | Analytics Vidhya
Analytics Vidhya
48 Demand for Data Engineers is on the Rise | Data Engineer | Analytics Vidhya
Demand for Data Engineers is on the Rise | Data Engineer | Analytics Vidhya
Analytics Vidhya
49 Data Visualization in Data Science | DataHour | Analytics Vidhya
Data Visualization in Data Science | DataHour | Analytics Vidhya
Analytics Vidhya
50 Role of Optimization in Machine Learning & Deep Learning | DataHour | Analytics Vidhya
Role of Optimization in Machine Learning & Deep Learning | DataHour | Analytics Vidhya
Analytics Vidhya
51 Solving any Machine Learning Problem | Approach and Steps Involved
Solving any Machine Learning Problem | Approach and Steps Involved
Analytics Vidhya
52 Topic Modeling Explained with Implementation | Using LDA in Python | DataHour by Arpendu Ganguly
Topic Modeling Explained with Implementation | Using LDA in Python | DataHour by Arpendu Ganguly
Analytics Vidhya
53 Data Engineering in E-Commerce | The Best Case Study
Data Engineering in E-Commerce | The Best Case Study
Analytics Vidhya
54 Introduction to Classification using Azure Machine Learning | DataHour | Analytics Vidhya
Introduction to Classification using Azure Machine Learning | DataHour | Analytics Vidhya
Analytics Vidhya
Introduction to Federated Learning | DataHour | Analytics Vidhya
Introduction to Federated Learning | DataHour | Analytics Vidhya
Analytics Vidhya
56 Diffusion Models for Generative Arts | DataHour | Analytics Vidhya
Diffusion Models for Generative Arts | DataHour | Analytics Vidhya
Analytics Vidhya
57 Master Google Analytics in 1 Hour | DataHour | Analytics Vidhya
Master Google Analytics in 1 Hour | DataHour | Analytics Vidhya
Analytics Vidhya
58 Learn Hypothesis Testing | DataHour | Analytics Vidhya
Learn Hypothesis Testing | DataHour | Analytics Vidhya
Analytics Vidhya
59 A Practical Approach to Kaggle Competition | DataHour | Analytics Vidhya
A Practical Approach to Kaggle Competition | DataHour | Analytics Vidhya
Analytics Vidhya
60 Making AI work for Business | DataHour | Analytics Vidhya
Making AI work for Business | DataHour | Analytics Vidhya
Analytics Vidhya

This video introduces the concept of federated learning, its importance in maintaining data privacy, and its applications in various fields. It also covers the basics of federated learning algorithms and provides a practical example of implementing federated learning using the Flower framework.

Key Takeaways
  1. Install Flower and Torch
  2. Import necessary libraries
  3. Create a CNN model with 2 convolutional layers and 1 linear layer
  4. Compile the model with Adam optimizer and ReLU activation function
  5. Train the model for 10 epochs
  6. Implement federated averaging for optimization
  7. Define custom metrics for error numbers and accuracy
  8. Implement minimum of 5 and maximum of 10 clients for training
💡 Federated learning is a powerful technique for maintaining data privacy while still allowing for the benefits of machine learning and AI.

Related AI Lessons

Up next
News At 10
Channels Television
Watch →