Identifying Parking Spots from Surveillance Cameras using CNN

Page 1

Identifying Parking Spots from Surveillance Cameras using CNN

1,3,4 B.TECH Scholars , Dept of Computer science and Engineering Hyderabad-501301,India

2 Professor, Dept of Computer Science and Engineering, SNIST, Hyderabad-501301, India

Abstract - Parking spot detection technology is used to detect empty parking spots using machine learning and deep learning algorithms. Parking spot detection technology can solve problems like traffic congestion, utilizationofspace,and time of many. This technology can further be implemented in the parking of autonomous vehicles, parking guidance systems, and parking management systems. Chancing for a proper parkingspace in a busy metropolitan city is a grueling issue and people are facing this problem daily. Parking systems are usually handled by a person. For this reason, it's time-consuming and also inaccurate. But numerous parking areas may have parking spaces that hard motorists are ignorant of. That being parking spot detection styles are based on different sensors. Lately, vision-based results have taken over with low-cost executions and installations. The proposed system uses image features and machine learning algorithms to determine whether or not an individualparking space is occupied. Accurate detection of parking spots can improve safety, and efficiency and save time for drivers. In the future, we can develop a less expensive way to do the same process. With accurate predictions, we can break from unnecessary trouble. If we apply machine learning tools, we can save human resources and skip the complicated process.

Key Words: Parkingspots,Convolutionalneuralnetwork, Cameras,Detection.

1. INTRODUCTION

Inmetropolitancitiesandpopularplacesfindingaparking spotisatime-consumingtaskandcausestrafficcongestion. Parking spot detection can help drivers to identify empty spots quickly which can save time for vehicle owners and can improve space utilization of parking lots. Finding an emptyparkingspotisdifficultinmanyplacesitcausestraffic congestionandisproblematicfordrivers.Theparkingspot detectiontechnologyhasalotofpotentialsandfuturescope. This technology can detect a parking spot with minimal resourcesandinshortspanoftime.Thistechnologycanbe further improved by providing a guidance system to the driverssothattheycanbedirectedtothenearestparking spot and can decrease traffic congestion. Accurate and efficient parking spot detection can help drivers locate availableparkingspacesquickly,reducingthetimeandfuel consumption spent searching for a parking spot. This technologycanbefurtherimprovedtofindtheparkingspot and then park in the place automatically. Traditionally, parking spot detection was approached using various methods such as image processing, machine learning, and computervisiontechniques.Thesemethodstypicallyinvolve

extracting features from images or video frames of the parking lot and applying classification or detection algorithms to identify the presence or absence of parked vehicles.Onepromisingapproachforparkingspotdetection istheuseofConvolutionalNeuralNetworks(CNNs),whichis atypeofdeeplearningalgorithmthathasachievedstate-ofthe-artperformanceinvariouscomputervisiontasks.CNN's areparticularlywell-suitedforparkingspotdetectiondueto theirabilitytoautomaticallylearnfeaturesfromrawdata and handle large amounts of variability in the data. For example, CNN can learn to recognize the shape and appearanceofvehiclesandparkingspaces,evenwhenthe datacontainsvariationsinlighting,backgroundclutter,or occlusion.

However,theapplicationofCNNsforparkingspotdetection has not been extensively studied in the literature. In this research,weaimtoinvestigatethepotentialofusingCNNs forparkingspotdetectionandevaluatetheirperformance comparedtootherapproaches.Ourcontributionsincludea detailedanalysisoftheCNN-basedparkingspot detection systemanditscomparisontootherstate-of-the-artmethods. Wewillalsodiscusstheadvantagesandlimitationsofusing CNNsforparkingspotdetectionandsuggestdirectionsfor futurework.

2. RELATED WORK

Parkingspotdetectionisanimportantprobleminintelligent transportationsystems,asitcanhelpimprovetheefficiency ofparkingandreducecongestioninurbanareas.Thereare severalapproachesthathavebeenproposedtoaddressthis problem,includingtraditionalcomputervisiontechniques, machinelearning algorithms, and deep learning methods. Onecommonapproachtoparkingspotdetectionistheuse ofhand-craftedfeaturesandclassifiers.Forexample,some studies have used color histograms, edge detection, and texture analysis toidentifyparkingspotsinimagesorvideo frames[1,2].Whilethesemethodscanbeeffectiveinsome cases, they may be sensitive to variations in lighting, shadows,andotherfactorsthatcanaffecttheappearanceof parkingspots.Anotherapproachistousemachinelearning algorithms, such as support vector machines (SVMs) or randomforests,toclassifyparkingspotsbasedonfeatures extractedfromimagesorvideoframes.Thesemethodshave beenshowntobeeffectiveinsomecases,butmayrequirea large amount of labeled data for training and may not generalizewelltonewenvironments[3,4].Recently,deep learning methods, particularly convolutional neural networks(CNNs),havebeenusedforparkingspotdetection

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

withpromisingresults.CNNsareparticularlywellsuited for this task because they can learn to extract features from imagesautomatically,withouttheneedformanualfeature engineering.Thiscanmakethemmorerobusttovariations inlightingandotherfactorsthatcanaffecttheappearanceof parkingspots.Forexample,somestudieshaveusedCNNsto detectparkingspotsinimagesorvideoframesbytraining onlargedatasetsoflabeledimages[5,6].Insummary,there have been several approaches proposed for parking spot detection,includingtraditionalcomputervisiontechniques, machine learning algorithms, and deep learning methods. Whileeachoftheseapproacheshasitsownadvantagesand limitations,CNNshaveshownpromiseasapowerfultool for thistaskduetotheirabilitytolearnfeaturesautomatically fromdata.

3. METHODOLOGY

Convolutional neural network (CNN) can be trained to identify emptyparkingspotsbyusinga labeleddatasetof images that includes both parking spots and non-parking spots. The CNN is trained to recognize the features of an emptyparkingspotintheimagesandtoclassifythemasa parkingspot.

To do this, the CNN typically goes through the following process:

 Feature extraction: The CNN processes the input image using a series of convolutional and pooling layers, which extract relevant features from the image. These features may include patterns, textures,edges,andshapesthatarecharacteristicof emptyparkingspots.

 Classification: The extracted features are then passedthroughafullyconnectedlayer,whichuses them to classify the image as a parking spot or a non-parkingspot.Thefullyconnectedlayerusesa setofweightsandbiasesthatarelearnedduringthe trainingprocesstomakethisclassification.

 Prediction: The CNN outputs a prediction for the class of the input image. If the prediction is a parkingspot,theCNNhasidentifiedtheimageasan emptyparkingspot.

 TotraintheCNN,alargedatasetoflabeledimages isusedtoteachtheCNNtorecognizethefeaturesof emptyparkingspots.TheCNNistrainedusingan optimizationalgorithm,suchasstochasticgradient descent (SGD), to minimize the loss function and improvetheaccuracyofthemodel.Aftertraining, theCNNcanbeevaluatedonaseparatetestdataset tomeasureitsperformance.

4. IMPLEMENTATION

Theparkingspotdetectionusesthecamerastocapturethe inputdataandthentheinputdataisanalyzedanddetectthe empty parking spots that are in the captured images. The imagescaptured willalsocontainunnecessary areathatis caughtintheimagethatcanbeignoredandweonlyneedto concentrate on the parking spots. After focusing on the parkingareaweneedtoidentifytheparkingspotsweneed toseparatethespotsbydrawingthelinesbetweenthespots and these are done by the model. The complete steps involvedintheprocessare

Collectandlabeldata:ThefirststepintrainingaCNNisto collectadatasetofimagesthatincludesbothparkingspots andnon-parkingspots.Eachimageinthedatasetshouldbe labeled with the correct class (i.e., parking spot or nonparkingspot).ThisdatasetwillbeusedtotraintheCNNto recognizeparkingspotsinnewimages.

•Preprocessthedata:Thedatasetmayneedtobe preprocessed to ensure that it is in a suitable format for training the CNN. This may include resizing the images, normalizing the pixel values, and applying any necessary transformationsoraugmentations.

•Define the CNN architecture: The next step is to definethearchitectureoftheCNN,whichinvolveschoosing thenumberandsizeoftheconvolutionalandpoolinglayer. The architecture should be designed to extract relevant featuresfromtheimagesandclassifythemintothecorrect classes.

•TraintheCNN:Oncethearchitectureisdefined,the CNNcanbetrainedusingthelabeleddataset.Thistypically involvesusinganoptimizationalgorithm,suchasstochastic gradient descent (SGD), to minimize the loss function and improvetheaccuracyofthemodel.

•EvaluatetheCNN:Aftertraining,theCNNshould be evaluated on a separate test dataset to measure its performance.Thiscanbedonebycalculatingmetricssuchas accuracy,precision,andrecall.

•Fine-tunetheCNN:IftheperformanceoftheCNN isnotsatisfactory,itmaybenecessarytofine-tunethemodel byadjustingthearchitecture,theoptimizationalgorithm,or thetraining.

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

The above lines of code are used to import the test and trained data and the modules which are used totrainthe model.

Theabovelinesofcodeareusedsothatfromtheimagedata weneedtoidentifytheparkingspotwhichhassomewidth and height. This helps us to separate the spots from one another.Thecodedrawslinesbetweenthespotssothatit canseparatestwospotsintheparkingarea

Intheimagedata thatisobtaineditalsocontainsthearea whichdoesnothaveanyparkingspotsotheabovelinesof codeareusedsothatwecanfocusontheparkingarearather thanthewholearea.Thishelpsusremovetheunnecessary imagedata.

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

Theabovecodeusesthepredefinedmodelthatisprovided by the keras module. VGG16 model is used to analyze the images and it uses the CNN to do that it consist of many layers which can be trained and the data is passed to this model so that it can learn from the given data and make predictionslater.Thevalidationdataisusedtovalidatethe modelandcheckhowaccurateitistotherealdata.

Results:

5.UML DIAGRAMS

5.1Use Case Diagram

Theusecasediagramoftheparkingspotdetectionisgivenas below.Ithastwoactorsuserandadmin.Adminhandlesthe system and maintains the servers, user requests for the parkingspotandtheadminaccesstothesystemwhilethe user can obtain the information regarding empty parking spot. Use case diagrams are useful for communicating the high-levelrequirements ofa systemtostakeholders,andfor identifyingthemainfunctionalitythatthesystemneeds to provide.Theyarealsousefulforidentifyingtheactorsand their interactions with the system, and for identifying any additionalfunctionalitythatmaybeneededtosupport the interactions.

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

5.2Class Diagram

Class diagrams are useful for representing the static structure of a system, and for understanding the relationships between the classes and their attributes and operations.Theyarealsousefulforidentifyingtheinterfaces anddependenciesbetweentheclasses,andforspecifyingthe attributesandoperationsoftheclassesinmoredetail.

5.4Activity Diagram

Theactivitydiagramoftheparkingspotdetectionshowthe actionflowandshowswheretheprocessstartedandwhere it

wasendedandithasswimlaneswhichshowsthesequence actionperformedbytheobjects.

Activity diagrams are useful for representing the flow of activitiesoractionsinasystem,andforunderstandingthe decisionpointsandbranchingpathsthatmayoccur.Theyare alsousefulforidentifyingtherelationshipsanddependencies betweentheactivitiesoractions,andforvisualizingtheflow ofcontrolinthesystem.

5.3Sequence Diagram

Thesequencediagramoftheparkingspot detectionshows theinteractionsandthelifetimeofthecomponents.

Sequencediagramsareusefulforrepresentingthedynamic behaviorofasystem,andforunderstandingtheinteractions betweentheobjectsorcomponentsinthesystem.Theyare also useful for identifying the relationships and dependenciesbetween the objects or components,and for visualizingtheflowofcontrolbetweenthem.

6.CONCLUSION

Inthisresearchpaper, weexploredtheuseof CNNsforthe taskofparkingspotdetection.WedescribedthespecificCNN architecturethatweused,aswellasthedatasetthatweused for training and testing. We presented the results of our experimentsanddiscussedanyinsightsorobservationsthat wegainedfromanalyzingtheresults.

Overall,ourresults showedthatCNNscanbeeffective for parkingspotdetectioninimagescapturedbya monocular cameramounted ona vehicle. Wefoundthatthe CNNwas able to learn complex features from the data and was relatively robust to variations in lighting conditions and objectappearances.

However,therearestillmanychallengestobeaddressedin this area, including the development of more robust and efficientCNNarchitecturesandthecreationoflarger,more diversedatasetsfortrainingandevaluation.Infuturework,it willbeimportanttoinvestigatetheseissuesinmoredepth,as well as to explore the potential applications of CNN-based parkingspotdetectioninreal-worldscenarios

7.REFERENCES

[

1]X.Lietal.,"Aparkingspotdetectionsystemusingcolor and texture features," IEEE Transactions on Intelligent TransportationSystems,vol.13,no.4,pp.1645-1654,2012.

[2]X.Liuetal.,"Animprovedparkingspotdetectionmethod based on edge detection and support vector machine," Sensors,vol.17,no.10,p.2392,2017.

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

[3]J. Y. Lee et al., "A parking spot detection system using support vector machine and color features," IEEE TransactionsonIntelligentTransportationSystems,vol.14, no.4,pp.1786-1795,2013.

[4]H. J. Kim et al., "A parking spot detection system using random forests and color features," IEEE Transactions on IntelligentTransportationSystems,vol.16,no.2,pp.865873,2015.

[5]L. Chen et al., "A parking spot detection method using convolutional neural network," IEEE Access, vol. 7, pp. 128,319-128,327,2019.

[6]Y. Huang et al., "Parking spot detection using convolutionalneuralnetworkandtransferlearning,"IEEE Access,vol.8,pp.168,514-168,522,2020.

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

Turn static files into dynamic content formats.

Create a flipbook