Individual discrimination of freely swimming pulse-type electric fish from electrode array recordings
Paulo Matias, Jan Frans Willem Slaets, Reynaldo Daniel Pinto
IIndividual discrimination of freely swimming pulse-typeelectric fish from electrode array recordings
Paulo Matias a, ∗ , Jan Frans Willem Slaets a , Reynaldo Daniel Pinto a a Department of Physics and Interdisciplinary Science, São Carlos Institute of Physics,University of São Paulo, Av. Trabalhador Sancarlense 400,13560-970 São Carlos, SP, Brazil
Abstract
Pulse-type weakly electric fishes communicate through electrical discharges witha stereotyped waveform, varying solely the interval between pulses according tothe information being transmitted. This simple codification mechanism is sim-ilar to the one found in various known neuronal circuits, which renders theseanimals as good models for the study of natural communication systems, allow-ing experiments involving behavioral and neuroethological aspects. Performinganalysis of data collected from more than one freely swimming fish is a chal-lenge since the detected electric organ discharge (EOD) patterns are dependenton each animal’s position and orientation relative to the electrodes. However,since each fish emits a characteristic EOD waveform, computational tools can beemployed to match each EOD to the respective fish. In this paper we describea computational method able to recognize fish EODs from dyads using normal-ized feature vectors obtained by applying Fourier and dual-tree complex waveletpacket transforms. We employ support vector machines as classifiers, and acontinuity constraint algorithm allows us to solve issues caused by overlappingEODs and signal saturation. Extensive validation procedures with
Gymnotus sp. showed that EODs can be assigned correctly to each fish with only twoerrors per million discharges.
Keywords:
Neuroethology, Electric organ discharge, Classification, Dual-treecomplex wavelet packet, Support vector machine, Continuity constraint
1. Introduction
Pulse-type weakly electric fishes such as
Gymnotus sp. are known for emit-ting electric organ discharges (EODs) used for electrolocation and electrocom-munication purposes [1, 2]. Because of the stereotyped nature of the electri-cal waveforms produced by these fish, research on electrocommunication typi-cally focus on analyzing measurements derived only from the occurrence instant ∗ Corresponding author. Tel.: +55 16 33738090; fax: +55 16 33739879.
Email address: [email protected] (Paulo Matias)
Preprint submitted to Neurocomputing September 23, 2018 a r X i v : . [ q - b i o . Q M ] D ec INTRODUCTION
EXPERIMENTAL METHODS Ref. channel di ff erential ampli fi ers x100 GND
DAQ: data acquisition board aquarium tank
Ref.
Figure 1: A pair of fish is placed in an aquarium tank containing eight electrodes in contactwith water. One of the electrodes is chosen as a reference electrode (ref.), in respect to whichthe voltage of all other electrodes is differentially amplified with a 100 times gain. Signalssampled at 50 kHz are then collected by a computer using a data acquisition board.
Fourier and dual-tree complex wavelet packet [21, 22] transforms. Then, thefact that waveforms vary continuously during fish movement is exploited to findEODs inside signal segments which might contain discharges from both fish.We also perform an extensive validation procedure during which dipoles areattached directly to each fish to capture the EODs whose timestamps are thencompared with the results of the developed algorithm in order to evaluate itserror rate, which we estimate as being only two parts per million.The paper is organized as follows. Section 2 introduces the experimentalmethods, explaining how measurements are carried, and also detailing the pro-cedure we perform to validate our method and evaluate its accuracy. Section 3describes both the discrimination method already present in literature and ourproposed algorithm. Finally, results are presented in Section 4 and conclusionsare drawn in Section 5.
2. Experimental methods
Our experimental setup is illustrated in Figure 1. Measurements are takenin a 64 liters glass aquarium tank containing eight stainless steel electrodes,located at the vertices of a 40 cm sided cube. The aquarium is mounted inside aFaraday cage to reduce the induction of external electrical noise. Electrodes witha diameter of 0.2 mm are inserted through the silicon glue at the corners of theaquarium, having about 1 to 2 mm of length in contact with the water. One ofthe electrodes is chosen as a reference, in respect to which the voltage of the otherseven electrodes is differentially amplified 100 times using LM308 operationalamplifiers. Once amplified, the seven signals are digitized at a sampling rate of
EXPERIMENTAL METHODS
450 kHz with a resolution of 12 bits by a National Instruments PCI MIO-16-E1data acquisition board and stored in a personal computer.When fish gets too close to the reference electrode, an exceeding voltagemay be produced between the reference and other electrodes, saturating signalsrecorded from all of them at the same time. To avoid this issue, we fixed a pieceof nylon tulle to the aquarium glass near the reference electrode, preventing fishfrom reaching it.Our aquarium geometry and electrode placement is the same adopted in [8].It is easy to replicate and provides an adequate signal to noise ratio (SNR)in at least one electrode independently of the fish position. However, nothingprecludes the algorithm described in this paper from being used with othergeometries, such as the round aquarium with multiple reference electrodes asdescribed in [7].
Experiments with a fish dyad are comprised by two steps which can be car-ried in any desired order. We call one of these steps the training stage, whichconsists of placing apart in the aquarium each individual, in turn, for some min-utes, during which the EODs of the freely swimming fish are collected. Typically,15 minutes of acquisition are enough to collect on the order of EODs, suf-ficient for training and testing our classifier. In order to acquire good qualitylabeled training and testing data, covering the system dynamics over most ofthe operating range, it is important to get the fish to swim around all aquarium.In
Gymnotus sp., this usually occurs naturally, as the fish has a tendency toexplore the surroundings when it is moved to a different environment [8]. Theexperimenter can also arouse an inactive animal by mechanically disturbing theaquarium.The other step, which we call the main experiment, consists of placing bothfish at the same time inside the aquarium. Data acquired in this step can bediscriminated by our algorithm, outputting a list of the occurrence instantsof EODs emitted by each fish. These instants are the final product of ourmethod, and can be analyzed and studied in order to research new behaviorand codification schemes occurring in fish electrocommunication.
To evaluate if our discrimination algorithm gave accurate results, we con-ducted experiments where electrodes were attached next to each fish and recordedin addition to the fixed electrode array already present in the aquarium. To keepthe electrodes near the fish, the wires of the electrodes were intertwined to anylon tulle, which was wrapped around the animals. Therefore, fish movementwas fairly restrained during these tests, demanding that we manually moved theindividuals around the aquarium, by pushing and pulling the wires, to simulatethe position displacements of a freely swimming fish.Instants of EOD emission could thus be directly obtained by applying a sim-ple threshold to the signal captured from the electrode tied to each individual.
DISCRIMINATION METHODS
Gymnotus sp. dyads were used for carrying this validationprocedure. For each dyad, two experiments were made. In the first one, both fishwere restrained by nylon tulle cover and manually moved around the aquarium.Then, during the second experiment, one arbitrarily chosen individual of thedyad was freed and allowed to swim, while the other fish was kept enclosed nearits electrode, and hence had its EOD instants directly measured.
3. Discrimination methods
Before discussing our algorithm, we briefly introduce our implementation ofthe cross-correlation method already described in literature [4], which we willuse for comparison purposes.Given a signal A [ · ] containing an unlabeled EOD, the method computes thecross-correlation T k (cid:63) A for both k = 1 and k = 2 . Each value of k correspondsto one fish of the dyad, and T k is the signal template of such fish. ( T k (cid:63) A ) [ i ] = l w − (cid:88) j =0 T k [ j ] · A [ i + j ] Where l w is the maximum length of an EOD in number of samples. Themethod then computes MaxCorr k , the maximum absolute value of the cross-correlation for the k -th fish, considering all the possible EOD starting instants i inside the signal A [ · ] . MaxCorr k = max i ∈ [ − l w ,l w ] | ( T k (cid:63) A ) [ i ] | Then the A [ · ] signal is classified as containing an EOD from “fish 1” if (MaxCorr − MaxCorr ) ≥ DecThreshold . Otherwise, it is classified as “fish2”. The decision threshold (
DecThreshold ) did not exist in the original method.We introduced it as a parameter that can be varied to plot receiver operatingcharacteristic (ROC) curves (e.g. Figure 5). Setting the threshold to zerorecovers the results of the original method.We choose templates T k by exhaustive search over all possible pairs of EODsextracted from subsets of labeled pulses selected at random from thosecollected during the training stage. We normalize them such that max j | T k [ j ] | =1 . We select the templates which provide the best classification accuracy on theother pulses of the training data, i.e. those not contained in the subsets wherethe template search is done.An issue of the cross-correlation method is the low accuracy it presents whenboth fish of a dyad emit EODs of almost the same pulse duration. Also, themethod does not include any means of dealing with overlapped EODs. Thus, DISCRIMINATION METHODS
Our discrimination algorithm works on signal segments which may containeither one or two EODs, respectively from a single fish or from both fish ofa dyad. Subsection 3.2.1 describes how these segments are obtained from theacquired signals. Then, the algorithm conceptually consists of two main steps:the classification of single fish segments and the dissociation of signal segmentscontaining EODs from both fish. The core of the first step is a support vectormachine (SVM) classifier. The extraction and the selection of features whichfeed the SVM are detailed, respectively, in Subsections 3.2.2 and 3.2.3, and theapplication of the SVM to classify segments containing a single EOD is depictedin Subsection 3.2.4. The second step consists of applying a continuity constraintto allow the discrimination of two EODs present in the same segment, which isportrayed in Subsection 3.2.5.
Data both from the training stage and from the main experiment are seg-mented before analysis. The purpose of this procedure is to detect EODs,distinguishing them from background noise, and to estimate the time span ofEOD activity on each detection.Signals A c [ · ] from all channels c are passed by a low-pass finite impulseresponse filter (Hamming window, 11-tap, Hz cutoff), differentiated andsquared. If the sum I [ · ] of the resulting signals surpasses a threshold value t d ,a segment of electric organ activity is detected. F c [ · ] = A c [ · ] ∗ Filter [ · ]∆ F c [ i ] = F c [ i + 1] − F c [ i ] I [ i ] = (cid:88) c (∆ F c [ i ]) Segment boundaries (starting and ending time instants s and e ) are deter-mined by iterating over samples of the summed signal I [ · ] , in both directions,starting at the position I [ d ] where detection ( I [ d ] > t d ) took place, until acertain number N b of contiguous samples ahead of the boundary is found to bebelow a minimum value t b , which is set to be lower than the detection threshold(such that t b < t d ). This procedure is shown in Figure 2 and described by theequations below. max (cid:40) s ∈ N , s < d : ∀ i ∈ N , ≤ i ≤ N b → I [ s − i ] < t b (cid:41) DISCRIMINATION METHODS Figure 2: Signals ∆ F c [ · ] , obtained by filtering and differentiating experimental data collectedfrom every channel c , are squared and summed to compute I [ · ] . When I [ · ] surpasses a t d threshold, a segment of EOD activity is detected. To establish the s (and e ) segmentboundaries, we look for a N b idle time occurring before (after) the signal goes below a t b threshold. DISCRIMINATION METHODS min (cid:40) e ∈ N , e > d : ∀ i ∈ N , ≤ i ≤ N b → I [ e + i ] < t b (cid:41) The parameter t d should be set just below the peak caused on I [ · ] by anEOD emitted when fish is at the position which leads to the minimum amplitudeof acquired signals, i.e. at the middle point of the aquarium; t b should beadjusted above the maximum noise floor; and N b should be greater than thenumber of contiguous I [ · ] samples of an EOD that might be below t b . Wehave developed a graphical user interface for adjusting these parameters whichshows an interactive graphic similar to the one presented in the figure. For ourexperimental setup, we have chosen t d = 0 .
06 V , t b = 0 . and N b = 16 .The filtering operation carried before segmentation is meant to reduce thesusceptibility to noise of s and e measurements. Filter choice is not criticalas long as the spiking shape of the EOD is preserved. The purpose of thedifferentiation is to remove any DC component that might be left on the signaldue to offsets in the acquisition system, avoiding spurious detections. Bothoperations are carried solely to aid EOD segmentation and their results are notused by the next steps of the algorithm. A less redundant approach is to replacethese two operations by a signal reconstruction from the second leaf of the thirdlevel of the wavelet transform employed in Subsection 3.2.2 (equivalent to asequence of low-pass, low-pass again, and finally high-pass filtering operations).This produces a frequency response which is very close to that of the alreadydescribed ∆ F c [ · ] signal, with the advantage of allowing the computed waveletsignal components to be subsequently reused.In order to compute feature vectors from a segment containing a single EOD,a signal window of a fixed length is needed. We choose a length l w large enoughto accommodate any single EOD, and center the segments into windows bycomputing window boundaries s (cid:48) = ( s + e − l w ) / and e (cid:48) = s (cid:48) + l w given the segmentboundaries s and e . In Gymnotus sp., pulse duration typically lies in the rangeof 1.8 to 2.2 ms, thus we choose l w = 128 (2.56 ms) when acquiring data at 50kHz. One set of features is independently computed for each channel c of the orig-inal signal A c [ · ] , as it was before filtering and differentiation. We have selectedfeature extraction schemes which produce output less sensitive to fish positionthan the time-domain signals. A simple approach is to compute the Fouriertransform ˜ A c [ · ] = F { A c [ s (cid:48) · · · e (cid:48) ] } of pulse signal windows, take the complexmagnitude (cid:12)(cid:12) ˜ A c [ · ] (cid:12)(cid:12) of the resulting values — which represents the amplitude ofeach frequency component without phase information — and finally normalizethe vector by dividing all the values by the largest one ( (cid:12)(cid:12) ˜ A c [ · ] (cid:12)(cid:12) / max i (cid:12)(cid:12) ˜ A c [ i ] (cid:12)(cid:12) ).Nonetheless, it has been reported [23] that some species of fish are ableto distinguish between pairs of different artificial EOD pulses possessing thesame amplitudes of the frequency spectrum. In the cited work, the artificialEODs were constructed by a superposition of two time-shifted components. DISCRIMINATION METHODS l w = 128 samples, treesdecompose the signals into log (cid:0) l w (cid:1) = 7 levels, each one containing 128 com-ponents. We independently normalize each level, by dividing all values by thelargest one present in the same level of the tree.In short, the DT-CWPT and Fourier transforms provide, respectively, l w · log (cid:0) l w (cid:1) = 896 and l w / = 64 signal components which, after normalized, canform the feature vectors. The number of signal components provided by DT-CWPT and Fourier trans-forms is large (960 in total). If all these components were used as features,training times would be excessively long and the model would likely overfit.Therefore, we select only 20 signal components to constitute the feature vectorsthat feed the classifier.To aid feature selection, we build two histograms for each signal component,one corresponding to each fish, as illustrated in Figure 3. These histograms havethe same bin intervals, so that the overlapping area, highlighted in the figure,can easily be calculated by integrating over the least of two bin heights at eachpoint. The minimum overlapping area (zero) would be obtained in the idealsituation where training set EODs could be perfectly classified using only thissingle feature. The maximum area (one) would be reached in the worst case,when probability distributions of the signal component are almost the same inboth fish, meaning the component is worthless for classification if used alone.Although signal components cannot be considered independent from eachother, we assume for simplicity that selecting the ones presenting the leasthistogram overlapping area makes a good feature set. For the problem at hand,
DISCRIMINATION METHODS − . − . . . . . . . . . . . . . . E s t i m a t edp r obab ili t y den s i t y Fish AFish BOverlap
Figure 3: The histogram of a Fourier or wavelet component can be employed to estimatethe probability distribution of its values. The overlapping area between histograms of thecomponent in two distinct fish is used as a measure of the uncertainty of classifying EODs ifonly this single feature was known. We adopt the straightforward feature selection approachof choosing the components presenting the least histogram overlapping area.
DISCRIMINATION METHODS
SVM classifiers were adopted because they frequently produce good resultsfor a variety of problems [26]. Furthermore, mature and optimized SVM softwarelibraries are readily available [27]. Each feature supplied to the classifier isrescaled to the [ − , interval, in order to prevent dominance of the featuresspanning the larger numeric ranges. Our implementation uses by default thegaussian radial basis function (RBF) kernel, usually considered a good firstchoice, since depending on its parameters it can also behave like linear or sigmoidkernels [28].Well-formed EOD signals (i.e. those which are non-saturated and have agood SNR, as verified by checking the EOD amplitude) obtained from a singlefish during training stage are randomly distributed into three sets, each onecontaining on the order of EODs if training stage was carried for about15 minutes per fish. One of them, the training set, is used to train the SVMmodel; another, the validation set, to count the number of errors throughout agrid search intended to find optimal RBF kernel and soft-margin parameters ( γ and C ); and the third, the testing set, to estimate final SVM performance onsingle fish discharge classification.Once the SVM model is trained, data collected from the main experimentcan be processed. Signal segments obtained from this data may contain eitheran EOD emitted by a single fish or EODs fired by both fish almost at the sametime. Diverse criteria are checked to establish with a high true negative rate(specificity) whether a certain segment contains a single EOD.First, we dismiss segments whose length ( e − s ) is greater than max { ¯ l + σ l , ¯ l + σ l } , where ¯ l j is the mean and σ l j is the standard deviation of the lengthof signal segments present in training data collected from the j -th fish alone. Wealso reject segments where less than N r of the available channels captured well-formed (good SNR, non-saturated) signals, and only consider pairs of adjacentsegments such that the time interval between their starting instants is less thanthe minimum discharge period attainable by a single fish, in which case theEODs were probably emitted by different individuals.Finally, the SVM model is employed to compute Platt [29, 30] probabilityestimators p c for every channel c containing a well-formed signal during eachsegment. If one of the products (cid:81) c p c or (cid:81) c (1 − p c ) is above a certain threshold t p , the associated segment is marked as being emitted by the first or by thesecond fish, respectively. Segments pertaining to an adjacent pair must havemarks corresponding to different fish, otherwise the classification is deemed asincorrect.We typically adopt N r = 2 and t p = 0 . . The larger the values of N r and t p , the greater the overall specificity of the single fish classifier. We donot recommend choosing N r > because it is rare to observe a well-formedEOD in more than two channels at the same time. Choosing N r = 1 can beeffective if one fish stayed for several seconds of the experiment in a position DISCRIMINATION METHODS − − − L , [ · − s ] ( V ) s Fish A − − − L , [ · − s ] ( V ) s Fish B − − − A [ · ] ( V ) Measured P j L j, . . . . . . . . . . . ( A − P j L j , ) ( V ) − − − L , [ · − s ] ( V ) s Fish A − − − L , [ · − s ] ( V ) s Fish B − − − A [ · ] ( V ) Measured P j L j, . . . . . . . . . . . ( A − P j L j , ) ( V ) · · ·· · ·· · ·· · · Figure 4: A segment of the A c [ · ] signals may contain EODs emitted by both fish almost atthe same time. In order to identify the positions s j where EODs emitted by the j -th fish startwithin the segment, we exploit the continuity property of EOD waveforms emitted by eachfish. The figure is organized as a grid, where each column comprises graphics presenting datarelated to a certain channel c of the signal. The first two lines show the L j,c vectors, whichcontain the last EOD previously recognized as being emitted by the j -th fish, displaced to thepositions s j being evaluated. In the third line, both displaced vectors are summed, and theresulting (cid:80) j L j,c are compared to the measured A c signals. In this example, no saturationoccurs, thus there is no need to apply the Ξ function defined in the text. The instants s j arechosen to minimize the sum of all squared distances displayed in the fourth line of the figure. of the aquarium where a well-formed EOD is captured by a single channel,but in these cases we recommend to compensate specificity by increasing t p tovalues in the order of . . Classification errors on this step of the algorithm willpropagate to the next pass (Subsection 3.2.5), therefore forcing a high specificityis important to get a final discrimination error in the order of parts per millioneven though the classification error of a single channel can reach hundreds ofparts per million (see Table 1). Whenever an adjacent pair of segments fulfilling the aforementioned criteriais detected, for both j ∈ { , } , vectors L j,c [ · ] are initialized with signals fromevery channel c , well-formed or not, belonging to the segment classified as con-taining a single EOD emitted by the j -th fish. Then, a continuity constraintis imposed to allow recognizing EODs present in subsequent signal segments,until the next criteria-satisfying adjacent pair is found. We assume that EODwaveforms collected from an individual vary smoothly, because fish position in RESULTS
Table 1: Results of a 10-fold cross-validation test carried applying our SVM based method onthe entire data set collected during the training stage, for six different dyads. the aquarium is a continuous function of time. This assumption is similar toan established approach [11] in spike sorting literature for solving the electrodedrift problem.Dissociation of signal segments containing EODs from both fish is thus for-mulated as an Euclidean distance minimization problem. Starting time instants s j of EODs emitted by the j -th fish are found by shifting the L j,c [ · ] vectors tothe positions s j being tested, summing shifted vectors corresponding to differentfish, and comparing the resulting signal to the current segment A c [ s · · · e ] , asdefined by the following equation and illustrated in Figure 4. argmin s , s (cid:88) i, c ( A c [ i ] − Ξ ( L ,c [ i − s ] + L ,c [ i − s ])) In our notation, L j,c [ i ] evaluates to zero whenever i is outside of the bounds( ≤ i < l w ). The function Ξ ( V [ · ]) roughly models the effect of differential am-plifier output signal saturation. If the maximum and minimum output voltageswing values are given by v sh and v sl , then Ξ can be defined as follows. Ξ ( V [ k ]) = v sh , if V [ k ] ≥ v sh v sl , if V [ k ] ≤ v sl V [ k ] , otherwiseWhen testing different s j values, we allow s to take a single value where L ,c [ i − s ] always evaluates to zero, meaning L ,c [ · ] alone is compared to A c [ s · · · e ] , and vice versa. This way, the Euclidean distance minimization stepcan also be employed to detect signal segments containing a single EOD whichwere dismissed by the previous criteria due to its high specificity. When thesesegments are identified, the algorithm updates the L j,c [ · ] vectors correspondingto the recognized fish j , in order to reflect the latest waveforms.
4. Results
First, we evaluated the SVM model alone regarding its ability to classifysignal windows containing a single EOD. We present in Table 1 the results ofa standard 10-fold cross-validation test conducted over all of the data collected
RESULTS Figure 5: Receiver operating characteristic (ROC) curves comparing SVM and cross-correlation methods for classifying signal windows of the testing set. Each window containeda single EOD emitted by an individual of a dyad (A and B fish). True positive rate denotesthe ratio of EODs emitted by fish A which were correctly identified. Likewise, false positiverate corresponds to the ratio of incorrectly identified EODs emitted by fish B. Graphics wereplotted for two different dyads, the ones which gave best and worst classification accuracy,respectively, among the six dyads used during experiments. during the training stage. In other words, not taking into account the divisioninto training, validation and testing sets mentioned in Subsection 3.2.4.We also compared our SVM approach to the cross-correlation method de-scribed in Subsection 3.1, by plotting the receiver operating characteristic (ROC)curves shown in Figure 5. The data set used to obtain these curves is disjointfrom the ones adopted to train the classifiers, i.e. curves were constructed basedon classification results of the testing set, employing models trained only withthe training set and with hyper-parameters optimized using the validation set.We plotted curves both for the best and for the worst case, corresponding to thedyads numbered 2 and 5 in Table 1, respectively. ROC results show that ourSVM approach performs consistently better than the cross-correlation method.In the worst case data set, where SVM displayed particularly superior accuracycompared to cross-correlation, EODs emitted by different individuals had almostthe same pulse duration, a situation on which the cross-correlation method isknown [4] to work poorly.Next, we analyzed data collected during the validation procedure (Subsec-tion 2.3). By comparing direct electrode measurements with the discriminationalgorithm results, we found a single non-detected EOD among . × pulses,resulting in an error rate in the order of two parts per million EODs. For thedischarge rate of a typical Gymnotus sp., this represents a mean interval of oneto two hours of data collection between errors.Finally, we observed inter-pulse interval (IPI) graphics plotted using resultsof the discrimination algorithm when applied to data collected with both fish of adyad freely swimming, absent of any directly attached electrodes. As individualswere not restrained in any way during this test, it was conducted the closer waypossible to a natural setting. Even though direct measurements are not availablein this sort of experiment, a kind of validation can still be carried, because the
RESULTS Figure 6: Inter-pulse interval (IPI) graphics plotted using two different discrimination algo-rithms, given the same data collected from a freely swimming fish dyad. On correct discrimi-nation, IPI is expected to be a piecewise continuous function. Signals from which we computedIPI were not used during training. Sub-figure (A) shows results from a previous version of ouralgorithm which used the SVM alone (without applying the waveform continuity constraint),and therefore had difficulties when both fish emitted EODs almost at the same time or whensome channel saturated. Discrimination errors can be easily pinpointed: region (i) containsmissed EODs, and is located approximately at the double IPI of the baseline; region (ii) con-tains false positives, presenting IPIs below the baseline. Sub-figure (B) displays results fromour fully implemented algorithm, as described in this paper. No errors can be pinpointed inits IPI graphic.
IPI curve for a fish is expected to be piecewise continuous. An individual canstop emitting EODs for a short period of time, but when it is emitting EODs,the pulse rate (and thus the IPI) varies smoothly.The left panel of Figure 6 shows the IPI obtained employing a previousversion of our algorithm, which did not incorporate the waveform continuityconstraint discussed in Subsection 3.2.5. It simply classified signal windowsusing SVM and treated a window as containing pulses from both fish wheneversignals of distinct channels were recognized as emitted by different fish. This ledto a numerous amount of false positives when signal saturation occurred, andto some missed EODs when both fish fired almost at the same time. We showthese results solely to illustrate that discrimination errors can be easily spottedin an IPI plot. One missed EOD appears as a point located at the double IPIof the baseline, as portrayed in the region (i) of the figure. Similarly, any EODsdetected by the algorithm which did not really exist appear below the baseline,as displayed in region (ii).On the other hand, the right panel of the figure shows the results of thefully implemented method, as described in Subsection 3.2. No errors can bepinpointed in this plot, as the IPI varies piecewise continuously for each fish.However, we stress the fact that this IPI continuity property is not exploitedby the discrimination algorithm. The continuity constraint used by our algo-rithm pertains only to the EOD waveform, which is a function of the spatiallocation of the fish, and is in no way related to the pulse rate. Therefore, nocyclic argument exists, and the fact that we observe smooth IPI curves when
CONCLUSIONS
5. Conclusions
We have presented a method able to accurately recognize the individualwhich emitted each electric organ discharge (EOD) during experiments con-ducted with freely swimming
Gymnotus sp. dyads. The obtained data is usefulfor analyzing and studying communication protocols employed by the animalsin a range of interesting situations, like mating, dominance relation establish-ment and territorial dispute, besides being important for shedding more light onfundamental issues, such as efficiency and redundancy of communication signalcoding, jamming avoidance response [31] and communication channel multiplex-ing mechanisms which might be present in these animals.Our method requires only a simple experimental setup, consisting of an arrayof fixed electrodes, conventional operational amplifier circuits for conditioningsignals, and a data acquisition system. Electrodes can be affixed to an aquariumor be mounted onto a structure which can be installed inside a fishpond. Unlikeprocedures carried in previous studies, no cameras are needed, allowing experi-ments to be easily carried in turbid waters, which are a common habitat of theseanimals [32]. Also, we are able to reliably process a large amount of collecteddata, which is essential for the attainment of more faithful results when apply-ing information theoretic and statistical approaches to analyze communicationsignals.Experiments carried out with
Gymnotus sp. gave outstanding discrimina-tion results, therefore we believe this method could be applied to other speciesof pulse-type electric fish, although it remains to be attested if those speciespresent individual distinguishable signatures which could be identified by oursupport vector machine (SVM) based classifier. Additionally, whilst we havedevised and implemented the method only for dealing with a fish dyad, it canbe naturally extended to process signals collected from more than two individ-uals. Notwithstanding, naively expanding the terms of the proposed continuityconstraint for handling more individuals would be too much computationallyexpensive due to the processing power needed to deal with the large amounts ofdata. Therefore, some heuristics would need to be developed in order to reducethe optimization search space.As a future work, we plan on implementing this algorithm in field-program-mable gate array (FPGA) hardware, employing a shift-register-like architecturefor the continuity constraint step. Such a device would allow us to obtain dis-criminated fish EOD instants with low latency and jitter characteristics. Thiswould be suitable for conducting a new range of real-time closed-loop experi-ments such as involving a third artificial fish communicating with the dyad.
EFERENCES Acknowledgements
This work was supported by a grant from the CAPES – Coordenação deAperfeiçoamento de Pessoal de Nível Superior – Brazilian agency. We alsoacknowledge the FAPESP – Fundação de Amparo à Pesquisa do Estado deSão Paulo – and CNPq – Conselho Nacional de Desenvolvimento Científico eTecnológico – agencies for their financial support for past and future projectsrelated to this work. We thank Lirio O. B. Almeida, Roland Köberle, Rafael T.Guariento and Krissia Zawadzki for reviewing our original manuscripts.
References [1] M.V. Bennett, H. Grundfest, Electrophysiology of electric organ in
Gymnotus carapo , J. Gen. Physiol. 42 (5) (1959) 1067–1104.[2] A.A. Caputi, M.E. Castelló, P. Aguilera, O. Trujillo-Cenóz, Electroloca-tion and electrocommunication in pulse gymnotids: signal carriers, pre-receptor mechanisms and the electrosensory mosaic, J. Physiol.-Paris 96(5–6) (2002) 493–505.[3] G.W. Max Westby, Has the latency dependent response of
Gymnotus carapo to discharge-triggered stimuli a bearing on electric fish communication?, J.Comp. Physiol. 96 (4) (1975) 307–341.[4] R.Y. Wong, C.D. Hopkins, Electrical and behavioral courtship displaysin the mormyrid fish
Brienomyrus brachyistius , J. Exp. Biol. 210 (2007)2244–2252.[5] K. Gebhardt, M. Böhme, G. von der Emde, Electrocommunication be-haviour during social interactions in two species of pulse-type weakly elec-tric fishes (Mormyridae), J. Fish Biol. 81 (7) (2012) 2235–2254.[6] G.W.M. Westby, Comparative studies of the aggressive behaviour of twogymnotid electric fish (
Gymnotus carapo and
Hypopomus artedi ), Anim.Behav. 23 (1975) 192–213.[7] J.J. Jun, A. Longtin, L. Maler, Precision measurement of electric organdischarge timing from freely moving weakly electric fish, J. Neurophysiol.107 (7) (2012) 1996–2007.[8] C.G. Forlim, R.D. Pinto, Automatic realistic real time stimula-tion/recording in weakly electric fish: Long time behavior characterizationin freely swimming fish and stimuli discrimination, PLoS ONE 9 (1) (2014)e84885.[9] G.W. Gross, E. Rieske, G.W. Kreutzberg, A. Meyer, A new fixed-arraymulti-microelectrode system designed for long-term monitoring of extracel-lular single unit neuronal activity in vitro, Neurosci. Lett. 6 (2-3) (1977)101–105.
EFERENCES
Brachyhypopomus pinnicaudatus , J. Comp. Physiol. A 195 (5)(2009) 501–514.[14] M.E. Arnegard, B.A. Carlson, Electric organ discharge patterns duringgroup hunting by a mormyrid fish, P. Roy. Soc. B-Biol. Sci. 272 (1570)(2005) 1305–1314.[15] P.K. McGregor, G.W.M. Westby, Discrimination of individually character-istic electric organ discharges by a weakly electric fish, Anim. Behav. 43(6) (1992) 977–986.[16] J.R. Gallant, M.E. Arnegard, J.P. Sullivan, B.A. Carlson, C.D. Hopkins,Signal variation and its morphological correlates in
Paramormyrops kings-leyae provide insight into the evolution of electrogenic signal diversity inmormyrid electric fish, J. Comp. Physiol. A 197 (8) (2011) 799–817.[17] W.G.R. Crampton, C.D. Hopkins, Nesting and paternal care in the weaklyelectric fish
Gymnotus (Gymnotiformes: Gymnotidae) with descriptions oflarval and adult electric organ discharges of two species, Copeia 2005 (1)(2005) 48–60.[18] C.D. Hopkins, Temporal structure of non-propagated electric communica-tion signals, Brain Behav. Evol. 28 (1–3) (1986) 43–59.[19] S.P. Strong, R. Koberle, R.R. de Ruyter van Steveninck, W. Bialek, En-tropy and information in neural spike trains, Phys. Rev. Lett. 80 (1998)197–200.[20] C. Cortes, V. Vapnik, Support-vector networks, Mach. Learn. 20 (3) (1995)273–297.[21] I. Bayram, I.W. Selesnick, On the dual-tree complex wavelet packet andM-band transforms, IEEE Trans. Sig. Proc. 56 (6) (2008) 2298–2310.[22] T. Weickert, C. Benjaminsen, U. Kiencke, Analytic wavelet packets: com-bining the dual-tree approach with wavelet packets for signal analysis andfiltering, IEEE Trans. Sig. Proc. 57 (2) (2009) 493–502.
EFERENCES
Pollimyrus adspersus (Günther, 1866),Behav. Ecol. Sociobiol. 55 (2) (2003) 197–208.[24] N. Kingsbury, Design of Q-shift complex wavelets for image processingusing frequency domain energy minimization, in: IEEE Image Proc., vol-ume 1, 2003, pp. 1013–1016. doi: .[25] G.H. John, R. Kohavi, K. Pfleger, Irrelevant features and the subset selec-tion problem, in: Proc. of the 11th International Conference on MachineLearning, New Brunswick, NJ, 1994, pp. 121–129.[26] D. Meyer, F. Leisch, K. Hornik, The support vector machine under test,Neurocomputing 55 (1–2) (2003) 169–186.[27] C.-C. Chang, C.-J. Lin, LIBSVM: A library for support vector machines,ACM Trans. Intell. Syst. Technol. 2 (3) (2011) 27:1–27:27.[28] C.-W. Hsu, C.-C. Chang, C.-J. Lin, A practical guide to support vector clas-sification, Technical Report, Department of Computer Science, NationalTaiwan University, 2010. URL: .[29] J.C. Platt, Probabilistic outputs for support vector machines and com-parisons to regularized likelihood methods, in: Advances in Large-MarginClassifiers, MIT Press, 1999, pp. 61–74.[30] H.-T. Lin, C.-J. Lin, R. Weng, A note on Platt’s probabilistic outputs forsupport vector machines, Mach. Learn. 68 (3) (2007) 267–276.[31] A. Capurro, C.P. Malta, Noise autocorrelation and jamming avoidanceperformance in pulse type electric fish, B. Math. Biol. 66 (4) (2004) 885–905.[32] O. Baffa, S.L. Correa, Magnetic and electric characteristics of the electricfish