Full text
Citation: Sigmund, M. Short-Term Entropy of Signal Energy Used for Effective Detecting of Weak Gunshots in Noisy Environments. Sensors 2024, 24, 4933. https://doi.org/10.3390/ s24154933 Academic Editor: Iren E. Kuznetsova Received: 1 July 2024 Revised: 26 July 2024 Accepted: 27 July 2024 Published: 30 July 2024 Copyright: © 2024 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/). sensors Article Short-Term Entropy of Signal Energy Used for Effective Detecting of Weak Gunshots in Noisy Environments Milan Sigmund Department of Radio Electronics, Faculty of Electrical Engineering and Communication, Brno University of Technology, Technicka 3082/12, 61600 Brno, Czech Republic; [email protected] Abstract: Conventional gunshot detection systems can quickly and reliably detect gunshots in the area where the acoustic sensors are placed. This paper presents the detection of weak hunting gunshots using the short-term entropy of signal energy computed from acoustic signals in an open natural environment. Our research in this field was primarily aimed at detecting gunshots fired at close range with the usual acoustic intensity to protect wild elephants from poachers. The detection of weak gunshots can extend existing detection systems to detect more distant gunshots. The developed algorithm was optimized for the detection of gunshots in two categories of the surrounding sounds, short impulsive events and continuous noise, and tested in acoustic scenes where the power ratios between the weak gunshots and louder surroundings range from 0 dB to − 14 dB. The overall accuracy was evaluated in terms of recall and precision. Depending on impulsive or noise sounds, binary detection was successful down to − 8 dB or − 6 dB; then, the efficiency decreases, but some very weak gunshots can still be detected at − 13 dB. Experiments show that the proposed method has the potential to improve the efficiency and reliability of gunshot detection systems. Keywords: gunshot detection; weak gunshots; short-term energy entropy; noisy environment; security and surveillance 1. Introduction The sound produced when fired is determined by the mechanical parameters of the weapon, such as the bullet caliber and barrel length, as well as the characteristics of the ammunition used. However, the measured sound may be influenced more or less by the acoustics at the place where the gunshot has been taken, depending on the shape of the natural relief, density of the surrounding vegetation, size and material of the surrounding buildings, and weather. More details about the effects of atmospheric factors (temperature, relative humidity, wind, and ground surface) to spread sound from gunshots can be found in [ 1 ]. For example, the propagation of the acoustic wave at night is slightly different due to the different temperature. The process of sound absorption in the air related to temperature and humidity is explained in [2]. Gunshots are very short, high-intensive impulse sounds. In real-world recordings, a muzzle blast typically lasts for 3 to 5 ms depending on the physical environment [ 3 ]. In an anechoic environment, the muzzle blast duration for common firearm types is less than 2 ms [ 4 ]. Details for determining the muzzle blast duration can be found in [ 4 ]. The sound pressure level (SPL) generated by small-caliber rifles, shotguns, and large-caliber handguns range from a 132 dB up to 172 dB peak SPL for high-powered firearms [ 5 ]. For example, the unweighted peak SPL produced by AK-15 rifle shots was measured to be 168 dB at a distance of 1.8 m and 150 dB at 4.3 m [ 5 ]. In fact, the SPL varies with the distance from the gunshot decreasing by approx. 6 dB for every doubling of the distance [ 3 ], and depends upon the direction relative to the barrel axis [ 6 ]. Due to the high SPL, some gunshots can be heard under normal atmospheric conditions at a distance of 2–3 km. Automatic gunshot detection systems are developed to continuously monitor locations where a gunshot could potentially be heard, even when no gunshot should occur Sensors 2024,24, 4933. https://doi.org/10.3390/s24154933 https://www.mdpi.com/journal/sensors
Sensors 2024,24, 4933 2 of 17 there. Depending on the monitored environment, gunshot detections fall into one of three categories, namely: •detection in an open nature environment [7,8]; •detection in an urban environment [9–11]; •detection in an indoor environment [12,13]. The type of firearms used usually varies depending on the purpose and, therefore, the place of use. While short, small-caliber weapons (pistols) are most often used indoors, in the open space, longer, larger-caliber weapons (rifles) or automatic weapons are used. An important aspect when developing a system for indoor, urban, or open natural spaces is the possible acoustic scene around the microphones. Any sounds similar to gunshots, in particular, play a significant role. The goal of gunshot detection is not only to correctly detect every gunshot, but also to ignore sounds that are not gunshots. In each type of environment, there are some common sounds that may resemble a gunshot, e.g., a door slamming indoors in a sudden draft, a car door slamming by a person in the street, wood chopping in the countryside, church bells ringing, etc. The main purpose of automatic gunshot detection is, on the one hand, to improve the safety of people (the prevention of violent crime and the investigation of crime scenes), and, on the other hand, to help reveal illegal poaching in wildlife areas (catching poachers). Of course, many gunshot detection techniques are required in military applications. Special systems for the detection and localization of gunshots are used in war operations to neutralize snipers. Such systems must operate in real time or near real time. A mobile shooter detection system suitable for installation on military patrol vehicles is presented in [ 14 ]. Some information on the detection of shots from a diverse range of military weapons can be found, for example, in [ 15 ]. Presentations of military systems are usually limited to an overall description of the entire system, focusing on the main advantages from a military perspective. In this article, gunshots in military scenarios are not taken into account. Our research into gunshot detection is focused on acoustic observation in open nature. A special gunshot detection application has been initiated by the Save Elephants society to protect elephants against poachers in Central Africa. Some wild elephants today wear collars that are equipped with a GPS module to track the movements of elephant herds in the wild. The collars can be additionally equipped with an autonomous gunshot detection module that sends a wireless alarm signal along with geographic co-ordinates of the gunshot location. In this case, real-time information about poaching events will be sent to the control center and alert anti-poaching teams. The guard team closest to the incident can then intervene immediately. An overview of the current monitoring of elephants in the wild can be found, for example, in [16]. In our current work, we focus on gunshot sounds that have a low signal energy. The reason for the low energy is usually the large distance between the acoustic source and the sensor. Since low-energy sounds are perceived as quiet or barely audible, such gunshots will be termed as “weak gunshots” hereafter. The detection of very weak gunshots in various noisy acoustic environments is not routinely performed in existing systems and can, therefore, be considered as an added value extending the applicability of standard acoustic monitoring systems. The rest of the article is organized as follows: In the next section, a brief overview of the current state of the art is given along with important related works. Section 3introduces the gunshot sound signal, including its propagation, describes the sound data used in the experiments, and defines the short-term entropy of the signal energy as an effective feature for weak gunshot detection. Experimental results achieved in tests with both short impulsive acoustic events and continuous noise are summarized in Section 4. Finally, Section 5concludes this paper. 2. Related Works In general, weak signals cover various specific waveforms that need to be dealt with in vast areas of signal processing such as wireless communication, biomedical sensors,
Sensors 2024,24, 4933 3 of 17 radar, sonar, etc. There is no uniform framework for exploiting weak signals. The methods used differ depending on the target application. In [ 17 ], a method is proposed for the detection of underwater weak signals in the complex sea background and the extraction of their frequencies. The detection of weak acoustic signals using stochastic resonance is described in [ 18 ]. Study [ 19 ] presents an analysis for the accurate parameter estimation of weak radiofrequency signals in a process with multiple simultaneous communication signals. Many recommendations for literature on weak signals in space exploration can be found in [ 20 ]. In an industrial application, weak signal recognition in the drilling process is solved in [ 21 ]. An interdisciplinary review on weak signal detection is given, for example, in [ 22 ]. In practical research, the accuracy of measuring and recording weak signals plays a key role. Paper [ 23 ] offers a review of precision lock-in amplifiers for applications in various weak signal areas. In the last two decades, various computer algorithms have been developed to detect dangerous sounds including gunshots, but high-performance algorithms are usually limited for use under specific conditions. Acoustic systems for the protection of tropical forests against potential destroying activities usually combine the detection of gunshots and chainsaws [ 24 ]. For security monitoring in urban areas, the detection of gunshots is often combined with the detection of glass breaking; see, for example, [ 25 ]. A generic emergency detection system based on sounds produced in an environment, where the gunshots are one of the observed emergency classes, is proposed in [ 26 ]. In general, gunshot detection algorithms use both specially developed features for gunshots, as presented, for example, in paper [ 27 ], and proven universal features for classifying many types of signals, such as spectrograms created using the Fourier transform [ 28 ] or wavelet transform [ 29 ]. The most common features used in acoustic signal processing are mel-frequency cepstral coefficients (MFCCs). These coefficients are based on the non-linear and masking psychoacoustic characteristics of human hearing. They are generally effective for recognizing sounds that can be distinguished by hearing, which also applies to distinctive gunshots. A detailed analysis of the first 40 MFCCs, as well as their differentiation ∆ and double differentiation ∆∆ extracted from gunshots, is given in [ 30 ]. An efficient modification of MFCCs for gunshot detection can be found in [31]. Most research publications present results obtained using user-friendly programming environments such as MATLAB or Python. Only few studies provide experience gained in hardware design and implementation. An attempt to implement and test gunshot detection on a field-programmable gate array (FPGA) is introduced in [ 32 ]. Paper [ 33 ] deals with some aspects of practical implementation in real time on a signal processor. A fully functional gunshot detection and localization system implemented as a prototype based on a micro-controller from the family SMT32 is presented in [34]. Almost all the approaches developed are for loud gunshots, sometimes with added low ambient noise. Research on the detection of weak gunshots is still not sufficiently addressed. To our knowledge, no previous publication has specifically focused on such a topic. Only one study also includes gunshots that have an energy lower than the energy of the background sounds [35]. Our results are compared with this study in Section 4. 3. Materials and Methods 3.1. Sound Signal of Gunshots Gunshots can be considered as impulses spreading into the surroundings in the atmosphere. Important parameters characterizing the propagation of gunshots through the air [36] are Mach number M=v/c(1) and Mach angle θM= arcsin(1/M), (2) where vis the bullet’s speed and cstands for the local speed of sound (typically c= 343 m/s at 20 ◦ C). As can be seen, the speed of the bullet vdetermines the direc-
Sensors 2024,24, 4933 4 of 17 tion of the shock wave propagation (assuming that cis constant in time and space of the gunshot). In case of a very fast bullet, Mis large, θM becomes small, and the shock wave propagates nearly perpendicularly to the path of the bullet. On the contrary, if the bullet’s speed is only slightly higher than the speed of the sound, Mis approximately equal to one, θM is almost 90 ◦ , and the shock wave propagates nearly parallel to the path of the bullet. The geometry of the supersonic shock wave propagation is depicted in Figure 1. The shaded area indicates possible range of the Mach angle. Sensors2024,24,xFORPEERREVIEW4of18 andMachangle θM=arcsin(1/M),(2) wherevisthebullet’sspeedandcstandsforthelocalspeedofsound(typicallyc=343 m/sat20°C).Ascanbeseen,thespeedofthebulletvdeterminesthedirectionoftheshock wavepropagation(assumingthatcisconstantintimeandspaceofthegunshot).Incase ofaveryfastbullet,Mislarge,θMbecomessmall,andtheshockwavepropagatesnearly perpendicularlytothepathofthebullet.Onthecontrary,ifthebullet’sspeedisonly slightlyhigherthanthespeedofthesound,Misapproximatelyequaltoone,θMisalmost 90°,andtheshockwavepropagatesnearlyparalleltothepathofthebullet.Thegeometry ofthesupersonicshockwavepropagationisdepictedinFigure1.TheshadedareaindicatespossiblerangeoftheMachangle. Figure1.Bulletshockwavepropagation. MachnumberalsopartiallydeterminestheshapeoftheN-wave,thetypicalinitial partofgunshotsignal.ThepeakpressuremaximumpmaxandthetimeintervalTbetween thepositiveandnegativepeaksintheN-wavearegivenbyequations 𝑝 0.53𝑃 𝑀1/ 𝑏/ 𝑑 𝑙/(3) 𝑇1.82 /,(4) whereP0isambientpressure,disthebulletdiameter,listhebulletlength,andbisthe distancebetweenthebullet’spathandthemicrophone(measuredasperpendiculardistance).Infreespace,thesoundenergyofthegunshotsdoesnotspreaduniformlyinall directions,butmostacousticenergyisconcentratednearthebarrelaxis.Manydetailson thewaveformshapeanditsdistortionduringshockpropagationcanbefoundin[37].A typicalgunshotsoundwaveformisshownindetailinFigure2. Figure2.Waveformofasinglegunshot. Figure 1. Bullet shock wave propagation. Mach number also partially determines the shape of the N-wave, the typical initial part of gunshot signal. The peak pressure maximum p max and the time interval Tbetween the positive and negative peaks in the N-wave are given by equations pmax =0.53P0M2−11/8 b3/4 d l1/4 (3) T≈1.82 d cMb l1/4 , (4) where P 0 is ambient pressure, dis the bullet diameter, lis the bullet length, and bis the distance between the bullet’s path and the microphone (measured as perpendicular distance). In free space, the sound energy of the gunshots does not spread uniformly in all directions, but most acoustic energy is concentrated near the barrel axis. Many details on the waveform shape and its distortion during shock propagation can be found in [ 37 ]. A typical gunshot sound waveform is shown in detail in Figure 2. Sensors2024,24,xFORPEERREVIEW4of18 andMachangle θM=arcsin(1/M),(2) wherevisthebullet’sspeedandcstandsforthelocalspeedofsound(typicallyc=343 m/sat20°C).Ascanbeseen,thespeedofthebulletvdeterminesthedirectionoftheshock wavepropagation(assumingthatcisconstantintimeandspaceofthegunshot).Incase ofaveryfastbullet,Mislarge,θMbecomessmall,andtheshockwavepropagatesnearly perpendicularlytothepathofthebullet.Onthecontrary,ifthebullet’sspeedisonly slightlyhigherthanthespeedofthesound,Misapproximatelyequaltoone,θMisalmost 90°,andtheshockwavepropagatesnearlyparalleltothepathofthebullet.Thegeometry ofthesupersonicshockwavepropagationisdepictedinFigure1.TheshadedareaindicatespossiblerangeoftheMachangle. Figure1.Bulletshockwavepropagation. MachnumberalsopartiallydeterminestheshapeoftheN-wave,thetypicalinitial partofgunshotsignal.ThepeakpressuremaximumpmaxandthetimeintervalTbetween thepositiveandnegativepeaksintheN-wavearegivenbyequations 𝑝 0.53𝑃 𝑀1/ 𝑏/ 𝑑 𝑙/(3) 𝑇1.82 /,(4) whereP0isambientpressure,disthebulletdiameter,listhebulletlength,andbisthe distancebetweenthebullet’spathandthemicrophone(measuredasperpendiculardistance).Infreespace,thesoundenergyofthegunshotsdoesnotspreaduniformlyinall directions,butmostacousticenergyisconcentratednearthebarrelaxis.Manydetailson thewaveformshapeanditsdistortionduringshockpropagationcanbefoundin[37].A typicalgunshotsoundwaveformisshownindetailinFigure2. Figure2.Waveformofasinglegunshot. Figure 2. Waveform of a single gunshot. In addition to real gunshots, we have also investigated synthetic gunshots intended for entertainment productions such as movies, computer games, etc. Such sounds are perceived by lay listeners as gunshots, but, in contrast to real gunshots, they usually have a different waveform. Especially in Western adventure movies (cowgirls), used synthetic gunshots have a longer duration and sound more pleasant than real gunshots. An example of such a gunshot is illustrated in Figure 3.
Sensors 2024,24, 4933 5 of 17 Sensors2024,24,xFORPEERREVIEW5of18 Inadditiontorealgunshots,wehavealsoinvestigatedsyntheticgunshotsintended forentertainmentproductionssuchasmovies,computergames,etc.Suchsoundsareperceivedbylaylistenersasgunshots,but,incontrasttorealgunshots,theyusuallyhavea differentwaveform.EspeciallyinWesternadventuremovies(cowgirls),usedsynthetic gunshotshavealongerdurationandsoundmorepleasantthanrealgunshots.AnexampleofsuchagunshotisillustratedinFigure3. Figure3.Exampleofasyntheticgunshotintendedforadventuremovies. 3.2.SoundDataUsed Foreffectivetrainingandtesting,itisimportanttohaveawiderangeofaudiodata representingnotonlythegunshots,butalsoambientsoundstypicallyfoundinthemonitoredsoundscape.Usefulinformationonvariousaudiodatabasesfocusingonmanyaudioevents,annotationtools,andaudiomanagementtoolscanbefoundin[38]. WeusedrecordingsfromourdatabasenamedGunshotDetectioninOpenNature (GUDEON),whichwasrecentlyspeciallycreatedforexperimentalresearchonpoacher shootingdetection.Thedatabasecontainsselectedsoundsofinterestcollectedfromseveralavailablesoundsources,aswellasourownrecordings.Thegunshotcategoryincludes1304soundsofhuntingweaponsandmilitaryassaultriflesusedbypoachersfor hunting.Sincethegunshotswererecordedwhilefiringoutdoorsinanopenarea,theaudiosignalsdonotcontainanyecho.Thenon-gunshotcategorycoverswildlifesounds (dogsbarking,elephantssnorting,andtrumpetcalls),vehiclesounds(off-roadcars,car horns,andlow-flyinghelicopters),humanscreams,etc.—atotalof983sounds.Allaudio signalsfromGUDEONusedinthefollowingtestswereinWAVaudioformat,monophonic,16-bit,andwitha44.1kHzsamplingrate.Theentiredatabaseisintroducedin [39]. Thelargestgroupofsoundsofthesametypeisrepresentedbygunshotsfromthe AK-47assaultrifle.Thisisnottypicallyahuntingweapon,butmostfrequentlyusedby poachersinCentralAfrica.Itcanproducetwokindsofgunshotsbyeitherfiringinsingle shotmodeorrapidburstmode.Figure4showsasequenceofgunshotsfiredautomatically inaburst.Thedistancebetweenindividualgunshotsinoneburstisapprox.90ms.The initialgunshotusuallyhasthemaximumamplitudeintheburst. Figure4.ExampleofshortburstfromanAK-47. Figure 3. Example of a synthetic gunshot intended for adventure movies. 3.2. Sound Data Used For effective training and testing, it is important to have a wide range of audio data representing not only the gunshots, but also ambient sounds typically found in the monitored soundscape. Useful information on various audio databases focusing on many audio events, annotation tools, and audio management tools can be found in [38]. We used recordings from our database named Gunshot Detection in Open Nature (GUDEON), which was recently specially created for experimental research on poacher shooting detection. The database contains selected sounds of interest collected from several available sound sources, as well as our own recordings. The gunshot category includes 1304 sounds of hunting weapons and military assault rifles used by poachers for hunting. Since the gunshots were recorded while firing outdoors in an open area, the audio signals do not contain any echo. The non-gunshot category covers wildlife sounds (dogs barking, elephants snorting, and trumpet calls), vehicle sounds (off-road cars, car horns, and lowflying helicopters), human screams, etc.—a total of 983 sounds. All audio signals from GUDEON used in the following tests were in WAV audio format, monophonic, 16-bit, and with a 44.1 kHz sampling rate. The entire database is introduced in [39]. The largest group of sounds of the same type is represented by gunshots from the AK-47 assault rifle. This is not typically a hunting weapon, but most frequently used by poachers in Central Africa. It can produce two kinds of gunshots by either firing in single shot mode or rapid burst mode. Figure 4shows a sequence of gunshots fired automatically in a burst. The distance between individual gunshots in one burst is approx. 90 ms. The initial gunshot usually has the maximum amplitude in the burst. Sensors2024,24,xFORPEERREVIEW5of18 Inadditiontorealgunshots,wehavealsoinvestigatedsyntheticgunshotsintended forentertainmentproductionssuchasmovies,computergames,etc.Suchsoundsareperceivedbylaylistenersasgunshots,but,incontrasttorealgunshots,theyusuallyhavea differentwaveform.EspeciallyinWesternadventuremovies(cowgirls),usedsynthetic gunshotshavealongerdurationandsoundmorepleasantthanrealgunshots.AnexampleofsuchagunshotisillustratedinFigure3. Figure3.Exampleofasyntheticgunshotintendedforadventuremovies. 3.2.SoundDataUsed Foreffectivetrainingandtesting,itisimportanttohaveawiderangeofaudiodata representingnotonlythegunshots,butalsoambientsoundstypicallyfoundinthemonitoredsoundscape.Usefulinformationonvariousaudiodatabasesfocusingonmanyaudioevents,annotationtools,andaudiomanagementtoolscanbefoundin[38]. WeusedrecordingsfromourdatabasenamedGunshotDetectioninOpenNature (GUDEON),whichwasrecentlyspeciallycreatedforexperimentalresearchonpoacher shootingdetection.Thedatabasecontainsselectedsoundsofinterestcollectedfromseveralavailablesoundsources,aswellasourownrecordings.Thegunshotcategoryincludes1304soundsofhuntingweaponsandmilitaryassaultriflesusedbypoachersfor hunting.Sincethegunshotswererecordedwhilefiringoutdoorsinanopenarea,theaudiosignalsdonotcontainanyecho.Thenon-gunshotcategorycoverswildlifesounds (dogsbarking,elephantssnorting,andtrumpetcalls),vehiclesounds(off-roadcars,car horns,andlow-flyinghelicopters),humanscreams,etc.—atotalof983sounds.Allaudio signalsfromGUDEONusedinthefollowingtestswereinWAVaudioformat,monophonic,16-bit,andwitha44.1kHzsamplingrate.Theentiredatabaseisintroducedin [39]. Thelargestgroupofsoundsofthesametypeisrepresentedbygunshotsfromthe AK-47assaultrifle.Thisisnottypicallyahuntingweapon,butmostfrequentlyusedby poachersinCentralAfrica.Itcanproducetwokindsofgunshotsbyeitherfiringinsingle shotmodeorrapidburstmode.Figure4showsasequenceofgunshotsfiredautomatically inaburst.Thedistancebetweenindividualgunshotsinoneburstisapprox.90ms.The initialgunshotusuallyhasthemaximumamplitudeintheburst. Figure4.ExampleofshortburstfromanAK-47. Figure 4. Example of short burst from an AK-47. 3.3. Method Based on Entropy of Energy The standard gunshot processing techniques begin by segmenting the audio signal into short segments. Then, in each segment, the relevant signal characters are extracted and collected in a feature vector. This principle is taken from the analysis of speech and music signals, where it has proven very effective. The algorithms used to obtain the feature vectors can be applied in both the time and frequency domain. In our research, we searched for efficient features to detect weak gunshots in a mixture of audio events. Practical experiments show very promising short-term entropy of signal
Sensors 2024,24, 4933 6 of 17 energy. It can be interpreted as a feature expressing unexpected sudden changes in the energy level of the observed audio signal. First, the short-term energy of the j-th segment of the discrete-time sound signal s(n) containing n= 1,. . ., Nsamples is computed E(j) = N ∑ n=1 |s(n)|2. (5) In the next step, each segment is divided into Ksub-segments of uniform length equal to Nsub =N/Kpoints, and, for each sub-segment k, the sub-segment energy is computed Esubk(j) = Nsub ∑ n=1 |s(n)|2, (6) where n= 1 is the beginning of the k-th sub-segment. Then, the energies of all sub-segments are normalized by the energy of the entire segment ek(j) = Esubk(j) E(j). (7) Finally, the entropy of energy in the j-th segment is computed from the sequence ek(j) H(j) = − K ∑ k=1 ek(j)ln[ek(j)]. (8) Experiments also show that the performance of the entropy H(j) can be further improved by appropriately weighting the audio signal using a short-term window. In order to estimate the effect of signal windowing on the entropy, the signal in each segment as well as in each sub-segment was windowed with two types of windows, namely, rectangular window r(n) = 1, (9) and Hamming window h(n) = 0.54 −0.46 cos(2πn/N). (10) In the window Functions (9) and (10), the variable nranges according to the segmentation from 1 to Nor from 1 to Nsub. Outside the window range, i.e., n/∈⟨1, N⟩ or n/∈⟨1, Nsub⟩ , the window values are zeros. The window function h(n), which tapers the signal amplitude toward both edges of the segment, is symmetric around the window center N/2, as can be seen in Figure 5. The rectangular window is the simplest window that requires minimal computation. The Hamming window is widely used window type in audio signal processing. This window highlights spectral lines, but reduces the signal energy at the edges of the window. Weak gunshots have low energy and this is further reduced by the Hamming window. It is useful, for example, in the processing of speech signals or music signals. The Hamming window was also used in practical testing of the proposed approach as a representative of tapered windows to show that, in this case, a rectangular window should be preferred not for its simplicity but for effectivity. As can be seen later in Section 4.2, the theoretical assumption was borne out experimentally. The signal flow in the algorithm for gunshot detection based on the short-term energy entropy is depicted in the block diagram in Figure 6. Methods based on the principle of energy entropy are adapted by researchers in various applications for detection and recognition of specific signals. When examining electroencephalographic signals, energy entropies mapping four basic frequencies were extracted in [ 40 ] to improve the accuracy of brain wave classification, which can be employed, for example, in the early detection of drowsiness in drivers [41]. In underwater signal processing, the combination of energy entropy and wavelet decomposition achieved the highest recognition rate for four types of ship radiation signals [ 42 ]. In speech signal processing, a method for highly accurate
Sensors 2024,24, 4933 7 of 17 detecting of the speech endpoints using logarithmic energy entropy of adaptive sub-bands was designed in [43]. Sensors2024,24,xFORPEERREVIEW7of18 Figure5.HammingwindowintimedomainforwindowlengthN=880. Thesignalflowinthealgorithmforgunshotdetectionbasedontheshort-termenergyentropyisdepictedintheblockdiagraminFigure6.Methodsbasedontheprinciple ofenergyentropyareadaptedbyresearchersinvariousapplicationsfordetectionand recognitionofspecificsignals.Whenexaminingelectroencephalographicsignals,energy entropiesmappingfourbasicfrequencieswereextractedin[40]toimprovetheaccuracy ofbrainwaveclassification,whichcanbeemployed,forexample,intheearlydetectionof drowsinessindrivers[41].Inunderwatersignalprocessing,thecombinationofenergy entropyandwaveletdecompositionachievedthehighestrecognitionrateforfourtypes ofshipradiationsignals[42].Inspeechsignalprocessing,amethodforhighlyaccurate detectingofthespeechendpointsusinglogarithmicenergyentropyofadaptivesub-bands wasdesignedin[43]. Figure6.Blockdiagramofsignalprocessingintheshort-termentropyofsignalenergy. 4.ExperimentalResultsandDiscussion Figure 5. Hamming window in time domain for window length N= 880. Sensors2024,24,xFORPEERREVIEW7of18 rectangularwindowshouldbepreferrednotforitssimplicitybutforeffectivity.Ascan beseenlaterinSection4.2,thetheoreticalassumptionwasborneoutexperimentally. Figure5.HammingwindowintimedomainforwindowlengthN=880. Thesignalflowinthealgorithmforgunshotdetectionbasedontheshort‐termen‐ ergyentropyisdepictedintheblockdiagraminFigure6.Methodsbasedontheprinciple ofenergyentropyareadaptedbyresearchersinvariousapplicationsfordetectionand recognitionofspecificsignals.Whenexaminingelectroencephalographicsignals,energy entropiesmappingfourbasicfrequencieswereextractedin[40]toimprovetheaccuracy ofbrainwaveclassification,whichcanbeemployed,forexample,intheearlydetectionof drowsinessindrivers[41].Inunderwatersignalprocessing,thecombinationofenergy entropyandwaveletdecompositionachievedthehighestrecognitionrateforfourtypes ofshipradiationsignals[42].Inspeechsignalprocessing,amethodforhighlyaccurate detectingofthespeechendpointsusinglogarithmicenergyentropyofadaptive sub‐bandswasdesignedin[43]. 0 200 400 600 800 0 0.5 1 h(n) n Segmentation Sub-segmentation Energy of sub-segments Normalization of sub-segment energies Entropy of segment energy Energy of segment Comparison with threshold Audio signal Sound Figure 6. Block diagram of signal processing in the short-term entropy of signal energy. 4. Experimental Results and Discussion The experimental analysis involves investigating the short-term entropy of the signal energy in various situations. The first series of experiments aimed to find the optimal combination of entropy parameters such as the segment size, number of sub-segments, logarithmization (ln vs. log), and, in addition, a suitable window type. The multi-parameter search was evaluated with respect to a reliable entropy threshold for gunshot detection. Based on the search results, the segment length was fixed at N= 880 samples, which represents a duration of 20 ms, each segment was divided into 10 sub-segments, logarithm naturalis (ln) was chosen, and the threshold value of 1.2 was set as the decision criterion for binary gunshot detection. These settings were used in further experiments.
Sensors 2024,24, 4933 8 of 17 Figure 7illustrates the energy and entropy curves computed using a rectangular window without overlapping. The acoustic scene here includes two single gunshots, one burst, a barking dog, a snorting elephant, and a car horn at the end. The loudest sounds are from elephants (twice). In places where the entropy curve H(j) falls under the threshold line, gunshots are detected. As can be seen, the single gunshots are reliable detected, but not all individual gunshots in the burst are correctly identified. This phenomenon also occurs in other test signals with a burst. However, such inaccuracy is not considered problematic because the burst is detected as a whole. Sensors2024,24,xFORPEERREVIEW8of18 Theexperimentalanalysisinvolvesinvestigatingtheshort-termentropyofthesignal energyinvarioussituations.Thefirstseriesofexperimentsaimedtofindtheoptimalcombinationofentropyparameterssuchasthesegmentsize,numberofsub-segments,logarithmization(lnvs.log),and,inaddition,asuitablewindowtype.Themulti-parameter searchwasevaluatedwithrespecttoareliableentropythresholdforgunshotdetection. Basedonthesearchresults,thesegmentlengthwasfixedatN=880samples,whichrepresentsadurationof20ms,eachsegmentwasdividedinto10sub-segments,logarithm naturalis(ln)waschosen,andthethresholdvalueof1.2wassetasthedecisioncriterion forbinarygunshotdetection.Thesesettingswereusedinfurtherexperiments. Figure7illustratestheenergyandentropycurvescomputedusingarectangularwindowwithoutoverlapping.Theacousticscenehereincludestwosinglegunshots,one burst,abarkingdog,asnortingelephant,andacarhornattheend.Theloudestsounds arefromelephants(twice).InplaceswheretheentropycurveH(j)fallsunderthethresholdline,gunshotsaredetected.Ascanbeseen,thesinglegunshotsarereliabledetected, butnotallindividualgunshotsintheburstarecorrectlyidentified.Thisphenomenonalso occursinothertestsignalswithaburst.However,suchinaccuracyisnotconsideredproblematicbecausetheburstisdetectedasawhole. Forcomparison,outofcuriosity,wefedthesignalsofsixsyntheticgunshotsintendedforfuntotheinputofthealgorithm.Thesesignalswereofnormalintensityand allwerecorrectlyrecognizedasnon-gunshots. (a) (b) Figure7.Short-termenergy(a)andentropy(b)withmarkedthresholdforgunshotdetection. 4.1.EvaluationMetrics Forassessingtheperformanceoftheproposedalgorithmwhenweakgunshotsand loudothersoundsoccur,weuseapowercomparisoncalledthegunshot-to-soundratio (GSR),whichisdefinedindecibels[dB]as aver 10 log10 S G GSR ,(11) whereGisthepowerofagunshot(i.e.,thepowerofashortsegmentcontainingthegunshot)andSaveristheaveragepowerestimatedfromnon-gunshotsoundsoverthetestaudiosignal.Thus,thecalculationofGSRisindependentofthetypeofnon-gunshotsounds surroundingthegunshot,aswellasthelengthofsilenceintervals. Inadditiontoimpulsivenon-gunshotsounds,theperformanceofthealgorithmwas alsotestedinacontinuousnoiseenvironment,whichcanbecharacterizedbythepower Figure 7. Short-term energy (a) and entropy (b) with marked threshold for gunshot detection. For comparison, out of curiosity, we fed the signals of six synthetic gunshots intended for fun to the input of the algorithm. These signals were of normal intensity and all were correctly recognized as non-gunshots. 4.1. Evaluation Metrics For assessing the performance of the proposed algorithm when weak gunshots and loud other sounds occur, we use a power comparison called the gunshot-to-sound ratio (GSR), which is defined in decibels [dB] as GSR =10 log10 G Saver , (11) where Gis the power of a gunshot (i.e., the power of a short segment containing the gunshot) and S aver is the average power estimated from non-gunshot sounds over the test audio signal. Thus, the calculation of GSR is independent of the type of non-gunshot sounds surrounding the gunshot, as well as the length of silence intervals. In addition to impulsive non-gunshot sounds, the performance of the algorithm was also tested in a continuous noise environment, which can be characterized by the power relationship between noise and gunshots as the gunshot-to-noise ratio (GNR) expressed in decibels [dB] as GNR =10 log10 G N, (12) where Gis the power of gunshots and Nis the long-term noise power estimated using the standard deviation over the whole noise signal.
Sensors 2024,24, 4933 9 of 17 To evaluate the overall accuracy of the detection approach, two standard metrics were used—recall, also termed sensitivity or the true positive rate, and precision, also termed the positive predictive value. These metrics are defined as percentages as follows Recall =TP TP +FN ·100, (13) Precision =TP TP +FP ·100, (14) where TP is the number of true positives (gunshots recognized as gunshots), FN is the number of false negatives (gunshots identified as non-gunshots, i.e., ignored gunshots) and FP is the number of false positives (non-gunshots mistaken for gunshots). These metrics were chosen considering that they do not contain true negatives, which represent much more acoustic events than the number of TPs in the real-world. The higher Recall and Precision values reflect a better performance of the algorithm. Ideally, they achieve 100%. 4.2. Overall Detection Accuracy with Ambient Impulsive Sounds In order to optimize the sound signal processing, we preliminarily investigated the effect of overlapping adjacent signal segments on the reliability of gunshot detection on a relatively small amount of data. In these tests, it was observed whether each gunshot is actually detected as a gunshot. The test signals contained counterbalanced groups of 100 single gunshots and 100 non-gunshots consisting of a dog barking, an elephant snorting, and a car horn. The overlap was gradually set to 10, 20, 30, 40, 50, and 60 percent of a fixed segment length of 20 ms. Based on the experimental results, the best overlap size appears to be 50 percent. In this case, the time overlap is 10 ms and the shift of the analyzed segment is also 10 ms. Table 1shows a comparison of the achieved detection rate for a 0% and 50% overlap at different GSR levels. A rectangular window was used in these tests. The improvement when applying a 50% overlap is clearly seen for moderately weak gunshots in the GSR range between −4 dB and −10 dB. Table 1. Effect of segment overlapping on percent detection rate at different GSR levels. GSR (dB) Non-Overlapping Overlapping 50% 0 100 100 −2 100 100 −4 92 100 −6 92 100 −8 58 83 −10 17 33 −12 14 14 −13 5 6 −14 0 0 The proposed algorithm was further tested using more diverse sounds. Here, the group of gunshots consists of 510 single gunshots and 62 bursts of different lengths from 5 to 18 individual gunshots in one burst. The non-gunshot group includes short and long dog barks, various elephant sounds, natural thunder, splashing water, breaking branches, a car horn, and human screams—a total of 585 sounds. In the binary detection of weak gunshots, the GSR levels were gradually decreased until detection failed completely. At each GSR level, the same input data were processed once using a rectangular window and once using a Hamming window. The achieved results in terms of Recall and Precision are shown in Table 2without segment overlapping and in Table 3with 50% overlapping.
Sensors 2024,24, 4933 16 of 17 Data Availability Statement: The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author. Conflicts of Interest: The author declares no conflicts of interest. References 1. Maher, R.C. Acoustical characterization of gunshots. In Proceedings of the IEEE Workshop on Signal Processing Applications for Public Security and Forensics, Washington, DC, USA, 11–13 April 2007. [CrossRef] 2. Harris, C.M. Absorption of sound in air versus humidity and temperature. J. Acoust. Soc. Am. 1966,40, 11–17. [CrossRef] 3. Samireddy, S.R.; Carletta, J.; Lee, K.-S. An embeddable algorithm for gunshot detection. In Proceedings of the 60th International Midwest Symposium on Circuits and Systems (MWSCAS), Boston, MA, USA, 6–9 August 2017. [CrossRef] 4. Routh, T.K.; Maher, R.C. Determining muzzle blast duration and acoustical energy of quasi-anechoic gunshot recordings. In Proceedings of the 141st Audio Engineering Society Convention, Los Angeles, CA, USA, 29 September–2 October 2016. Paper 9635. 5. Mlynski, R.; Kozlowski, E. Selection of level-dependent hearing protectors for use in an indoor shooting range. Int. J. Environ. Res. Public Health 2019,16, 2266. [CrossRef] [PubMed] 6. Maher, R.C.; Routh, T.K. Wideband audio recordings of gunshots: Waveforms and repeatability. In Proceedings of the 141st Audio Engineering Society Convention, Los Angeles, CA, USA, 29 September–2 October 2016. Paper 9634. 7. García-de-la-Puente, N.P.; Fuentes-Hurtado, F.; Fuster, L.; Naranjo, V.; Piñero, G. Deep learning models for gunshot detection in the Albufera Natural Park. In Proceedings of the 31st European Signal Processing Conference (EUSIPCO), Helsinki, Finland, 4–8 September 2023. [CrossRef] 8. Katsis, L.K.D.; Hill, A.P.; Pina-Covarrubias, E.; Prince, P.; Rogers, A.; Doncaster, C.P.; Snaddon, J.L. Automated detection of gunshots in tropical forests using convolutional neural networks. Ecol. Indic. 2022,141, 109128. [CrossRef] 9. Shiekh, A.A.; Tahir, M.; Uppal, M. Accurate gunshot detection in urban environments using blind deconvolution. In Proceedings of the IEEE International Multitopic Conference (INMIC), Lahore, Pakistan, 24–26 November 2017. [CrossRef] 10. Momynkulov, Z.; Dosbayev, Z.; Suliman, A.; Abduraimova, B.; Smailov, N.; Zhekambayeva, M.; Zhamangarin, D. Fast Detection and Classification of Dangerous Urban Sounds Using Deep Learning. Comput. Mater. Contin. 2023,75, 2191–2208. [CrossRef] 11. Calhoun, R.; Lamkin, S. Determining the source location of gunshots from digital recordings. In Proceedings of the 153rd Audio Engineering Society Convention, New York, NY, USA, 19–20 October 2022. Express Paper 18. 12. Rahman, S.U.; Khan, A.; Abbas, S.; Alam, F.; Rashid, N. Hybrid system for automatic detection of gunshots in indoor environment. Multimed. Tools Appl. 2021,80, 4143–4153. [CrossRef] 13. Khan, T. Towards an indoor gunshot detection and notification system using deep learning. Appl. Syst. Innov. 2023,6, 94. [CrossRef] 14. Mazurek, J.A.; Barger, J.E.; Brinn, M.; Mullen, R.J.; Price, D.; Ritter, S.E.; Schmitt, D. Boomerang mobile counter shooter detection system. In Proceedings of the Sensors, and Command, Control, Communications, and Intelligence Technologies for Homeland Security and Homeland Defense IV, Orlando, FL, USA, 28 March–1 April 2005. [CrossRef] 15. Deshpande, D.; Jain, M.; Jajoo, A.; Kadam, D.; Kadam, H.; Kashyap, A. Next-gen security: YOLOv8 for real-time weapon detection. In Proceedings of the 7th International Conference on I-SMAC (IoT in Social, Mobile, Analytics and Cloud), Kirtipur, Nepal, 11–13 October 2023. [CrossRef] 16. Brickson, L.; Vollrath, F.; Titus, A.J. Elephants and algorithms: A review of the current and future role of AI in elephant monitoring. J. R. Soc. Interface 2023,20, 20230367. [CrossRef] [PubMed] 17. Shen, Y.; Li, Y.; Li, W.; Gao, H.; Wu, C. A novel underwater weak signal detection method based on parameter optimized VMD and 3D chaotic system. Digit. Signal Process. 2024,151, 104571. [CrossRef] 18. Zhou, H.; Luo, X.; Chen, L. A weak acoustic signal line-spectrum detection method based on stochastic resonance. In Proceedings of the 6th International Conference on Information Communication and Signal Processing (ICICSP), Xi’an, China, 23–25 September 2023. [CrossRef] 19. Smith, B.; Lanzerotti, M. Multi-tier dynamic sampling weak RF signal estimation theory. EURASIP J. Adv. Signal Process. 2024, 2024, 7. [CrossRef] 20. Kasal, M. SlabéSignály (Weak Signals); VUTIUM: Brno, Czech Republic, 2023. (In Czech) 21. Yang, Y.; Chen, J.; Gao, Y.; Fan, H. Detection of weak signal-to-noise ratio signal while drilling based on duffing chaotic oscillator. In Proceedings of the 6th International Conference on Information Science and Control Engineering (ICISCE), Shanghai, China, 20–22 December 2019. [CrossRef] 22. Georgiadis, D.; Raubal, M. An Interdisciplinary Review on Weak Signal Detection; Singapore-ETH Centre: Singapore, 2020. [CrossRef] 23. Zhang, Q.; Jeong, W.; Kang, D.J. Lock-in amplifiers as a platform for weak signal measurements: Development and applications. Curr. Appl. Phys. 2024,66, 95–109. [CrossRef] 24. Somwong, B.; Kumphet, K.; Massagram, W. Acoustic monitoring system with AI threat detection system for forest protection. In Proceedings of the 20th International Joint Conference on Computer Science and Software Engineering, Phitsanulok, Thailand, 28 June–1 July 2023. [CrossRef] 25. Lojka, M.; Pleva, M.; Kiktova, E.; Juhar, J.; Cizmar, A. Efficient acoustic detector of gunshots and glass breaking. Multimed. Tools Appl. 2016,75, 10441–10469. [CrossRef]
Sensors 2024,24, 4933 17 of 17 26. Sharma, J.; Granmo, O.C.; Goodwin, M. Emergency detection with environment sound using deep convolutional neural networks. Adv. Intell. Syst. Comput. 2021,1184, 144–154. [CrossRef] 27. Hrabina, M.; Sigmund, M. Gunshot recognition using low level features in the time domain. In Proceedings of the 28th International Conference Radioelektronika, Prague, Czech Republic, 19–20 April 2018. [CrossRef] 28. Bajzik, J.; Prinosil, J.; Jarina, R.; Mekyska, J. Independent channel residual convolutional network for gunshot detection. Int. J. Adv. Comput. Sci. Appl. 2022,13, 950–958. [CrossRef] 29. Tardif, B.; Lo, D.; Goubran, R. Gunshot sound measurement and analysis. In Proceedings of the 2021 IEEE Sensors Applications Symposium (SAS), Sundsvall, Sweden, 23–25 August 2021. [CrossRef] 30. Baliram Singh, R.; Zhuang, H. Measurements, analysis, classification, and detection of gunshot and gunshot-like sounds. Sensors 2022,22, 9170. [CrossRef] 31. Sigmund, M.; Hrabina, M. Efficient feature set developed for acoustic gunshot detection in open space. Elektron. Elektrotech. 2021, 27, 62–68. [CrossRef] 32. Gaikwad, N.B.; Khare, S.K.; Ugale, H.; Mendhe, D.; Tiwari, V.; Bajaj, V.; Keskar, A.G. Hardware design and implementation of multi-agent MLP regression for the estimation of gunshot direction on IoBT edge gateway. IEEE Sens. J. 2023,23, 14549–14557. [CrossRef] 33. Hrabina, M.; Sigmund, M. Implementation of developed gunshot detection algorithm on TMS320C6713 processor. In Proceedings of the 2016 SAI Computing Conference, London, UK, 13–15 July 2016. [CrossRef] 34. Svatos, J.; Holub, J. Impulse acoustic event detection, classification, and localization system. IEEE Trans. Instrum. Meas. 2023, 72, 6501515. [CrossRef] 35. Papadimitriou, I.; Vafeiadis, A.; Lalas, A.; Votis, K.; Tzovaras, D. Audio-based event detection at different SNR settings using two-dimensional spectrogram magnitude representations. Electronics 2020,9, 1593. [CrossRef] 36. Maher, R.C. Modeling and signal processing of acoustic gunshot recordings. In Proceedings of the 12th Digital Signal Processing Workshop, Jackson Lake, WY, USA, 24–27 September 2006. [CrossRef] 37. Stoughton, R. Measurements of small-caliber ballistic shock waves in air. J. Acoust. Soc. Am. 1997,102, 781–787. [CrossRef] 38. Datasets. Available online: http://www.cs.tut.fi/~heittolt/datasets.html (accessed on 25 July 2024). 39. Hrabina, M.; Sigmund, M. Audio event database collected for gunshot detection in open nature (GUDEON). J. Audio Eng. Soc. 2019,67, 54–59. [CrossRef] 40. Yang, Z.; Luo, S.; Zhong, P.; Chen, R.; Pan, C.; Li, K. An EMD and IMF energy entropy-based optimized feature extraction and classification scheme for single trial EEG signal. J. Mech. Med. Biol. 2023,23, 2340063. [CrossRef] 41. Krishnan, P.; Yaacob, S. Drowsiness detection using band power and log energy entropy features based on EEG signals. Int. J. Innov. Technol. Explor. Eng. 2019,8, 830–836. [CrossRef] 42. Li, Y.; Ning, F.; Jiang, X.; Yi, Y. Feature extraction of ship radiation signals based on wavelet packet decomposition and energy entropy. Math. Probl. Eng. 2022,2022, 8092706. [CrossRef] 43. Zhu, M.; Huang, P.C.; Zhang, J. Speech endpoint detection method based on logarithmic energy entropy product of adaptive sub-bands in low signal-to-noise ratio environments. Int. J. Biom. 2024,16, 272–286. [CrossRef] 44. Raza, A.; Rustam, F.; Mallampati, B.; Gali, P.; Ashraf, I. Preventing crimes through gunshots recognition using novel feature engineering and meta-learning approach. IEEE Access 2023,11, 103115–103131. [CrossRef] 45. Valliappan, N.H.; Pande, S.D.; Vinta, S.R. Enhancing gun detection with transfer learning and YAMNet audio classification. IEEE Access 2024,12, 58940–58949. [CrossRef] 46. Janjua, Z.H.; Vecchio, M.; Antonini, M.; Antonelli, F. IRESE: An intelligent rare-event detection system using unsupervised learning on the IoT edge. Eng. Appl. Artif. Intell. 2019,84, 41–50. [CrossRef] 47. Giannakopoulos, T.; Pikrakis, A.; Theodoridis, S. A multi-class audio classification method with respect to violent content in movies using Bayesian networks. In Proceedings of the IEEE 9th Workshop on Multimedia Signal Processing (MMSP), Chania, Greece, 1–3 October 2007. [CrossRef] 48. Abbasi, A.; Javed, A.R.R.; Yasin, A.; Jalil, Z.; Kryvinska, N.; Tariq, U. A large-scale benchmark dataset for anomaly detection and rare event classification for audio forensics. IEEE Access 2022,10, 38885–38894. [CrossRef] Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.