DYNAMIC ENERGY MANAGEMENT USING REAL TIME OBJECT DETECTION

Page 1

DYNAMIC ENERGY MANAGEMENT USING REAL TIME OBJECT DETECTION

Student, Dept. of Electronics and Communication Engineering

Student, Dept of Electronics and Communication Engineering

Student, Dept of Electronics and Communication Engineering

Student, Dept. of Electronics and Communication Engineering

PSG College of Technology Coimbatore, India

PSG College of Technology Coimbatore, India

PSG College of Technology Coimbatore, India

PSG College of Technology Coimbatore, India

Assistant Professor, Dept. of Electronics and Communication Engineering

PSG College of Technology Coimbatore, India ***

Abstract - The system mainly concentrates on the human detection using YOLO CV2 algorithm and sectoring the area intofourparts.ThehardwarerequirementsusedisRaspberry Pi4 and webcam. The software requirements include YOLO CV2 and VNC viewer to display the area detected by the camera. The sectored area in the software is merged with the area that has been chosen in real time in which camera identifies a human detection in a particular sector and the specified sector is alone turned on instead of using the electrical energy in the whole unused space. The project's primary goal is to minimize energy usage dynamically. Additionally, the project incorporated intrusion detection, automatic on & off of the system at specified timing, and to alert when unwanted movement is detected.

Key Words: MachineLearning,EnergyManagement,Object Detection,ElectricalControl,IntruderDetection

1.INTRODUCTION

Theproject'sobjectiveistominimizeenergyconsumption bymanagingelectricaldevicesthroughhumandetectionina designatedarea.Theobservationarea isdivided into four sectors, and each sector's electrical devices are managed separatelybasedonhumanpresenceinthatsector.Todetect andidentifyhumanpresence,MachineLearningalgorithms areemployed.TheRaspberryPiservesasthecentralunitfor theproject,andaworkingprototypehasbeendevelopedina real-timeenvironment.Overall,theproject'sinnovativeuse of YOLO CV2 algorithm provides an efficient and costeffectivesolutionforenergymanagementandsecurity.

1.1 OBJECT DETECTION

Objectdetectionplaysacrucialroleinvideoprocessing, allowing computers to automatically identify and track objectsinreal-time.Videoobjectdetectionisusedinavariety of applications, including security and surveillance, traffic monitoring, and autonomous vehicles. To perform object detectionin video processing, algorithms typicallyanalyze frames of video by identifying objects and tracking their

movements over time. However, this process can be challenging due to factors such as changes in lighting, occlusion, and object deformation. To overcome these challenges, our project developed various techniques, including deep learning-based methods, to improve the accuracy and speed of object detection in videos. Additionally,advancementsincomputerhardwareandGPUacceleratedcomputinghaveenabledreal-timevideoobject detectionandtracking,makingitanessentialtoolforawide rangeofapplications.

1.2 IMAGE SEGMENTATION

Imagesectoring,alsoknownasimagesegmentation,isthe process of dividing an image into multiple segments or regionsbasedoncertaincriteria,suchascolour,texture,or shape.Thistechniqueiswidelyusedincomputervisionand image processing applications, including object detection, image recognition, and scene analysis. In the context of reducing electricity consumption, image sectoring can be usedtoidentifythepresenceofhumansinaparticulararea or sector, such as a classroom or office space. Image sectoring can be performed using various algorithms and techniques, such as thresholding, clustering, and edge detection. These algorithms can be tailored to specific applications and environments, allowing for accurate and reliable detection of human presence in different spaces. Additionally, advancements in computer vision and deep learning technologies have enabled more advanced image sectoring algorithms that can analyse images in real-time anddetectmorecomplexpatternsandobjects.

Object detection and sectoring images are two critical tasksthatrelyheavilyonobjectdetectiontechnology.Object detectionenablescomputerstorecognizeandlocateobjects inimagesorvideos,whilesectoringimagesinvolvesdividing an image into smaller segments or regions. By combining these techniques, we effectively identify and analyse the contentsofanimageorvideo.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page114

1.3 YOLO CV2 ALGORITHM

TheYOLOCV2(YouOnlyLookOnce,OpenCV2)algorithmis a popular object detection algorithm that can be used for humandetectioninvideo.Thisalgorithmusesadeepneural network to analyze video frames and detect objects, including humans, in real-time. YOLO CV2 is particularly effective for human detection because it can accurately identify individuals even in crowded scenes or low-light environments. This algorithm can also detect people in differentposesandorientations,makingitaversatiletool forhumandetection.Additionally,YOLOCV2canbetrained oncustomdatasets,allowingittobetailoredtospecificuse casesorenvironments.Overall,theYOLOCV2algorithmhas proventobeaneffectivetoolforhumandetectioninawide range of applications, including security and surveillance, trafficmonitoring,andsportsanalysis.

1.4 RASPBERRY PI 4

Dividing a room into four sectors using image sectoring algorithmscanbeaneffectivewaytodetecthumanpresence andcontrollightingandfansinthatareatoreduceelectricity consumption.ToimplementthisapproachusingaRaspberry Pi4,severalhardwarecomponentsandsoftwaretoolsare used.

The Raspberry Pi 4 isa small,single-boardcomputer that can be used for a variety of applications, including image processingandmachinelearning.Todetecthumanpresence ineachsectoroftheroom,acameramodulecanbeattached to the Raspberry Pi 4 and used to capture images of the room. The images can then be processed using image sectoringalgorithmstoidentifythepresenceofhumansin eachsector.

Tocontrolthelightingandfansineachsector,theRaspberry Pi 4 can be connected to a relay module or a set of smart switches.Therelaymodulecanbeusedtoturnthelightsand fansonoroffbasedonthehumanpresencedetectedineach sector.

Toimplementthissystem,programminglanguagessuchas Pythoncanbeusedtodevelopthesoftwarethatrunsonthe Raspberry Pi 4. Libraries such as OpenCV can be used to perform image processing tasks, while the GPIO (General Purpose Input/Output) pins on the Raspberry Pi 4 can be usedtocontroltherelaymoduleorsmartswitches.

2.

Figure-2 outlines the process flow of the methodology proposed. The detection of humans is implemented using YOLO CV2 algorithm. This is followed by Hardware implementation where sectorized control is done over electricalappliances.

2.1

YOLO stands for “You Only Look Once”. It is an algorithm whichcandetectseveralobjectsinaphotoandrecognizeit

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page115
Fig -1: RaspberryPi4PinLayout PROPOSED METHODOLOGY Fig-2: MethodologyFlowchat YOLO CV2 ALGORITHM Fig-3: YOLOCV2AlgorithmicArchitecture

instantly. Each object type is a separate class in YOLO algorithmanddetectionisdoneasaregressionproblem.

YOLOusesconvolutionalneuralnetworks(CNN)toperform real-timeobjectdetection.Theadvantageofthealgorithmis thatitonlyneedsonesingleforwardpropagationthrough theCNNtoidentifytheobject.Hence,asinglealgorithmrun issufficienttoidentifyandpredictobjectsinawholeimage. The YOLO CNN can predict various class probabilities simultaneouslyalongwiththeboundingboxes.

Figure-3showsthearchitectureoftheYOLOalgorithm.The initial 20layersarepre-trainedusingImageNet.Sincethe convolutionalandconnectedlayersofapretrainedmodelis used,itimprovesperformance.ThefinallayersofYOLOare thefullyconnectedlayerswhichpredicttheclassprobability andthecoordinatesofboundingboxes.

Forthisapplication,theCOCO(CommonObjectinContext) data set is used to train the YOLO algorithm. The COCO datasetconsistsofvariousobjectsencounteredindailylife. Outofallthoseobjects,thecoconame“people”iscompared with the recognized objects and if found a match, then it proceedswiththeenergymanagementflow.

2.2 SECTORING

A novel factor introduced in the proposed energy management system is sectoring. Sectoring refers to the division of an area into a fixed number of sectors. For the easeofimplementationandtesting,thenumberofsectorsis fixedasfourintheproject.

Insteadofcontrollingonlyindividualdevicesatatimeoran entire premises or area, sectoring allows controlling the electricity supply in smaller areas. This allows the energy saving to be more than the existing solutions. When the algorithmdetectsthepresenceofahuman,theco-ordinates of the sector in which they are present is obtained. This allowsonlythefanandlightsinthatsectortobeturnedon while others remain switched off. Also, if multiple sectors canbeonatthesametime.

2.3 HARDWARE METHODOLOGY

Fig-4: FlowchartofProposedHardwareImplementation

Intheimplementedsystem,theRaspberryPiandNodeMCU modulesare bothutilizedasshowninFigure-4.Real-time objectdetectionandidentificationareperformedusingthe RaspberryPi,withtheassistanceofaPi-Cam.TheRaspberry Pialsoservesasthecontrollingmodule,whichutilizesthe processeddataoutputstocontroltheelectricaldevices.To connecttheRaspberryPiwiththeNodeMCU,asharedserver isutilized.TheNodeMCUis responsiblefordecentralizing theRaspberryPimoduleandcontrollingtheswitchforthe electricaldevices.Theapproachusedinthissysteminvolves firstdetectingobjectsthroughthecamerafeedprovidedby thePi-Cam.Then,identificationoftheobjectsiscarriedout usingalgorithmsprogrammedintotheRaspberryPimodule. When an object is detected or not detected for a specific durationoftime,acorrespondingoutputisactivated.This output is then wirelessly transmitted to the NodeMCU module,whichislinkedtothecontrolswitchforregulating thepowersupplytotheelectricaldevices.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page116

3. IMPLEMENTATION

3.1 INITIALIZING THE NECESSARY MODULES

InordertoimplementaPythonprogramthatcapturesand processesvideos,controlstheGPIOportsofaRaspberryPi, andconnectstoanMQTTbroker,itisnecessarytoimport severalmodules.ThefirstmodulerequiredisCV2,whichis usedtocaptureandperformvideos.TheTimemoduleisalso essential, as it helps to represent time in the code. Additionally, the RPi.GPIO module is needed to allow the Python code to control the GPIO ports of a Raspberry Pi. Finally, the Paho.mqtt module provides a client class to connect with an MQTT broker, which is necessary for communicatingwithother devicesorsystems.Oncethese modules are imported, the Python program can begin implementingitsfunctionality.

3.2 SECTORING

To accurately determine the location of a person or individual in a room, the image must be split into four coordinatesorsectors,witheachsectorbeing320x320 in size.Thisallowsforprecisecalculationsoftheindividual's positionwithintheroom.

AsshowninFigure6,theimagedisplaysthecoordinatesof each sector, enabling the system to identify the exact locationofthepersonbasedonthecoordinates.Thismethod iseffectiveinvariousapplications,suchassecuritysystems orindoornavigation

Inordertoidentifyandlocateanindividualwithinaroom, theYOLOalgorithmisutilized,andagreenboundingboxis introducedaroundtheidentifiedperson.Thisboxallowsfor easycaptureandscalingofthepersonorobject,simplifying theprocessofmarkingandlocatingtheindividualwithinthe room.

AsshowninFigure-5,whenapredefinedobject(inthiscase, anindividual)isidentifiedintheviewedarea,thebounding boxesareinitializedtosurroundtheobject.Thepositionof the anchors within the box determines the location of the individualwithrespecttothesector.Iftheboxisinthefirst sector, for example, the system can determine that the person is located within the first sector of the room. This systemiseffectiveinvariousapplications,suchassecurity monitoringortrackingindividualswithinafacility.

3.3 CONTROLLING LIGHTS

Upon detecting a person within a particular sector of the room,thedevices(suchaslightsandfans)configuredwith thatsectorareactivated.Therearedifferentcasesthatmay occurwhenapersonisdetected.Inthefirstcase,ifaperson isdetectedinonlyonesector,thedevicescorrespondingto thatsectorareturnedon.

If people are detected in one or more sectors, the sectors where the bounding boxes are present will have the correspondingdevicesturnedon.Thissystemensuresthat

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page117
Fig -5:SectoringImageFeed Fig -6:Co-Ordinatesofindividualsectors 3.3.1 CASE-1-DETECTION IN ONE SECTOR Fig-7: Personinonesector 3.3.2 CASE-2-DETECTION IN MULTIPLE SECTOR

energy is not wasted on powering devices in unoccupied sectors, making it more efficient and cost-effective. Additionally,itallowsforgreatercustomizationandcontrol overthedeviceswithintheroom.

lightbulbsbyreceivingcommandsfromtheRaspberryPi. ThissetupallowsforthedecentralizationoftheRaspberry Piandtheelectricaldevicecontrollingmodule.Arelayisalso included in the setup, which acts as a connecting node between the controlling modules and the electrical appliances.Itsfunctionistocontrolthecircuit.

3.5 RESULT & ANALYSIS

The YOLOCv2 Deep LearningAlgorithm wasadaptedand utilizedfordetectingandrecognizinghumanpresenceina livevideofeed.Thesystemwasdesignedtocovertheentire fieldofviewbysegmentingthevideofeedintofourequalsizedsectors.Thealgorithmidentifiedthepositionofobjects ineachsector,andbasedonthedurationoftheirpresence, theelectricalappliancesinthecorrespondingsectorwere controlled.

After several rounds of testing and training, the detection efficiencyofthealgorithmwassignificantlyenhanced,and the system was implemented in real-time. The Node MCU servedasasecondarycontrolunittomanagethelightbulbs onthecommandsreceivedfromtheraspberrypi.

3.4 WIRELESS DATA TRANSFER

Tocontrolthedevicesinthesystem,theinputGPIO(General Purpose Input/Output) pins are initially set to low. When dataispassedtothesepins,thevaluesaresettohigh,which triggersthecorresponding devicestoturnon.Similarly,if thereisnodetectionofhumansintheroom,thepinvalues are set to low, which causes the devices to turn off automatically.Thismechanismallowsthesystemtorespond dynamicallytochangesintheenvironment,turningonoroff devices as needed based on the presence or absence of peopleintheroom

Inapracticalapplication,four50W(3000lumen)lightbulbs were turned on forsixhours.Accordingtothetheoretical calculation, each light bulb would consume 180 Joules of energyperhour,accumulatingtoatotalenergyconsumption of 4320 Joules. However, in the real-time scenario, the systemcontrolledthebulbsinsuchawaythateachsector hadanindividualbulb,andthetimeperiodforwhicheach bulbwaspoweredwasmeasured.Asaresult,thecombined energy consumption was reduced to 2700 Joules. This indicates that the system is capable of reducing energy consumptioninreal-worldscenarios.

4. CONCLUSIONS

Thesetupconsistsofacentralcontrollingelement,whichis aRaspberryPi.ItisconnectedtoaPi-Camthatcapturesrealtimevideos.Additionally,aNODEMCUisusedtocontrolthe

The primary goal of the project is to enhance energy efficiencybyreducingenergyconsumption.Acost-effective

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page118
Fig-8: Multiplepeopleidentifiedinmultiplesectors Fig-9: ThesetupofthefinalmodelusingNodeMCU Fig-10: Personisidentifiedinthesectoranddatais transferredtotheNodeMCU

prototypehasbeendevelopedthatutilizesmachinelearning algorithms to capture and process real-time video feed, enablingittooperateeffectivelyinreal-worldenvironments. Themachinelearningalgorithmhasbeentrainedandtested for object detection and identification to improve its efficiency.

Duringareal-timeinference,thesystemwasabletoreduce energyconsumption bycontrollingthelightsaccordingto their needs. By powering the lights only when a human presencewasdetected,energyconsumptionwasreducedby 20%.Thetheoreticalenergyconsumptionforfour50-watt lightbulbsturnedonforsixhourswascalculatedtobe4320 Joules, buttheactual energy consumption wasreducedto approximately2700Joules,resultingina37.5%decreasein energy usage. Additionally, the system can function as an intrusionalertsystembytriggeringanalarmwhenhuman presenceisdetectedatunwantedtimes

REFERENCES

[1] M.ThakurandS.BanuJ.,"RealTimeObjectDetection in Surveillance Cameras with Distance Estimation using Parallel Implementation," 2020 International Conference on Emerging Trends in Information TechnologyandEngineering,February2020.

[2] Y. Yoon and D. Han, "Object Recognition and Distance Extraction System Using Camera," 2021 International ConferenceonArtificialIntelligenceinInformationand Communication(ICAIIC),April2021.

[3] L.QinandZ.Liu,"BodyMotionDetectionTechnology in Video," 2021 3rd International Conference on RoboticsandComputerVision(ICRCV),August2021.

[4] L. Ma, F. Xu, T. Li and H. Zhang, "A Moving Object Detection Method Based on 3D Convolution Neural Network," 2020 7th International Conference on InformationScienceandControlEngineering(ICISCE), December2020.

[5] Giao N. Pham, Suk-Hwan Lee, Ki-Ryong Kwon, "AutomaticLEDLighting SystemUsing MovingObject Detection by Single Camera", proceedings of the 7th internationalconferenceonelectronicdevices,systems, andapplications(ICEDSA2020),December2020.

[6] Q.ZhengandR.Chellappa,"Motiondetectioninimage sequencesacquiredfromamovingplatform,"2018IEEE International Conference on Acoustics, Speech, and SignalProcessing,Minneapolis,MN,USA,2018.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 06 | Jun 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page119

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
DYNAMIC ENERGY MANAGEMENT USING REAL TIME OBJECT DETECTION by IRJET Journal - Issuu