DrCoffey / DeepSqueak

DeepSqueak v3: Using Machine Vision to Accelerate Bioacoustics Research
BSD 3-Clause "New" or "Revised" License
371 stars 89 forks source link

Adjusting inter-call interval settings? #62

Closed s1782988 closed 3 years ago

s1782988 commented 5 years ago

Hi Kevin and Russell,

I am running into a bit of a problem with long 22kHz rat calls. The detector tends to only detect portions of the long calls, and it is not usually possible to manually correct this because the view is zoomed so that the ends of the call are usually cut off. I think this must be because the long calls tend to have small breaks in the sound, but I would like to count them as one call unless they are separated by at least 20ms (like in Wright et al.). I would also like to do this for short calls, as sometimes the detector bins calls which are temporally quite separate together, and sometimes splits up what I would count as a single call. Is there a way to do this? I have used your detectors as well as training my own, and I seem to always have the same outcome.

Thanks for all your help!

Raven

DrCoffey commented 5 years ago

Hey Raven,

Would you be willing to share an audio file with 22s that has this issue. We have a bit of code built in to separate long 22s and I might be able to turn it off without breaking everything.

The short calls are a little harder. We have settings to adjust the overlap ratio for merging calls, but they are deep in the code. If you don't mind digging into code, the merge_boxes.m file has the thresholds.

line 22: OverlapMergeThreshold = .15;

-Kevin

s1782988 commented 5 years ago

Attachment available until 28 Nov 2019 Hi Kevin,

Thanks for your quick reply! I will try playing around with the merge threshold and see if it helps for the short calls.

Attached is an example file with the 22s.

Click to Downloadhttps://www.icloud.com/attachment/?u=https%3A%2F%2Fcvws.icloud-content.com%2FB%2FAb-D3N5AF0BDGpRUbAWr8zxoEA_XAQ0FmEGKjU430DHgtaBgAvRB3fyv%2F%24%7Bf%7D%3Fo%3DAmJttdwQMOWCXEgdfAKeM7cVqSghR5XsePTr4aUq1uGL%26v%3D1%26x%3D3%26a%3DCAogOxTlsRa5asHPhiL9N356qLjlT4dp9D8V8riEZVWdvVMSJxDOxrK64S0YztatjustIgEAKggByAD_NKxKtFIEaBAP11oEQd38rw%26e%3D1574940928%26k%3D%24%7Buk%7D%26fl%3D%26r%3D5DB49417-A0A5-4B4E-A2B7-9BA4A0FD847A-1%26ckc%3Dcom.apple.largeattachment%26ckz%3D32595A16-AF7D-4896-953E-3FA7AADFE2F3%26p%3D15%26s%3D4C0vheX02oRnnS9e7NA88Cnd32o&uk=KRuq8RwcUy9KQTm2KDc3QA&f=18.9.19%20tickle_20%202.wav&sz=171140240 18.9.19 tickle_20 2.wav 171.1 MB

Best, Raven


Raven Hickson PhD student, Kind Lab Centre for Discovery Brain Sciences University of Edinburgh

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.

On 28 Oct 2019, at 22:22, DrCoffey notifications@github.com<mailto:notifications@github.com> wrote:

Hey Raven,

Would you be willing to share an audio file with 22s that has this issue. We have a bit of code built in to separate long 22s and I might be able to turn it off without breaking everything.

The short calls are a little harder. We have settings to adjust the overlap ratio for merging calls, but they are deep in the code. If you don't mind digging into code, the merge_boxes.m file has the thresholds.

line 22: OverlapMergeThreshold = .15;

-Kevin

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/DrCoffey/DeepSqueak/issues/62?email_source=notifications&email_token=ALJKTWCQFKSA4BCG5PR333LQQ5Q3HA5CNFSM4JFBWZK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECOSVNQ#issuecomment-547170998, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALJKTWGFSMB555VZNARLYX3QQ5Q3HANCNFSM4JFBWZKQ.

s1782988 commented 5 years ago

Hi Kevin,

Sorry to come back again with another problem! When I export to Raven, the USV label is not being added for some reason to ‘Annotation’ and instead they are all ‘1’, I think maybe because the calls were accepted. What can I do to fix this?

Thank you! Raven


Raven Hickson PhD student, Kind Lab Centre for Discovery Brain Sciences University of Edinburgh

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.

On 28 Oct 2019, at 22:22, DrCoffey notifications@github.com<mailto:notifications@github.com> wrote:

Hey Raven,

Would you be willing to share an audio file with 22s that has this issue. We have a bit of code built in to separate long 22s and I might be able to turn it off without breaking everything.

The short calls are a little harder. We have settings to adjust the overlap ratio for merging calls, but they are deep in the code. If you don't mind digging into code, the merge_boxes.m file has the thresholds.

line 22: OverlapMergeThreshold = .15;

-Kevin

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/DrCoffey/DeepSqueak/issues/62?email_source=notifications&email_token=ALJKTWCQFKSA4BCG5PR333LQQ5Q3HA5CNFSM4JFBWZK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECOSVNQ#issuecomment-547170998, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALJKTWGFSMB555VZNARLYX3QQ5Q3HANCNFSM4JFBWZKQ.

DrCoffey commented 5 years ago

That was an easy one! The annotations column is now the call type, just re-download, or pull off github desktop.

s1782988 commented 5 years ago

That’s great, thanks so much!!


Raven Hickson PhD student, Kind Lab Centre for Discovery Brain Sciences University of Edinburgh

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.

On 31 Oct 2019, at 23:52, DrCoffey notifications@github.com<mailto:notifications@github.com> wrote:

That was an easy one! The annotations column is know the type, just re-download, or pull of github desktop.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/DrCoffey/DeepSqueak/issues/62?email_source=notifications&email_token=ALJKTWHL5ISLGYU4FZTFJATQRNVUVA5CNFSM4JFBWZK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECZS53Y#issuecomment-548613871, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALJKTWDARLK3CGHXF3CEY7DQRNVUVANCNFSM4JFBWZKQ.

s1782988 commented 5 years ago

Hi Kevin,

I think that this might be the issue:

[cid:ED82DC28-85E1-48A4-8BC5-A8216D228871@ed.ac.uk]

It says the merge boxes function is ‘Currently Off’ and when I export the detections to Raven, I can see that in fact many of the selections are overlapping by quite a lot but have not been merged for some reason. How do I turn this on? Maybe that will help with the fragmented 22s issue?

Best, Raven


Raven Hickson PhD student, Kind Lab Centre for Discovery Brain Sciences University of Edinburgh

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.

On 28 Oct 2019, at 22:22, DrCoffey notifications@github.com<mailto:notifications@github.com> wrote:

Hey Raven,

Would you be willing to share an audio file with 22s that has this issue. We have a bit of code built in to separate long 22s and I might be able to turn it off without breaking everything.

The short calls are a little harder. We have settings to adjust the overlap ratio for merging calls, but they are deep in the code. If you don't mind digging into code, the merge_boxes.m file has the thresholds.

line 22: OverlapMergeThreshold = .15;

-Kevin

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/DrCoffey/DeepSqueak/issues/62?email_source=notifications&email_token=ALJKTWCQFKSA4BCG5PR333LQQ5Q3HA5CNFSM4JFBWZK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECOSVNQ#issuecomment-547170998, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALJKTWGFSMB555VZNARLYX3QQ5Q3HANCNFSM4JFBWZKQ.

DrCoffey commented 5 years ago

Hey, I think that is just an old comment, the merge boxes code does run. It has to because if you increase recall with the slider it actually detects the whole image a second time and has to merge overlapping boxes. You could try the following things to increase merging... Change SpueakDetect.m Line 175 from

    Calls = merge_boxes(AllBoxes, AllScores, AllClass, AllPowers, audio_info, 1, score_cuttoff, 0);

to

    Calls = merge_boxes(AllBoxes, AllScores, AllClass, AllPowers, audio_info, 1, score_cuttoff, 1);

The 1 will tell the code to enlarge the boxes a little to aid in merging. or lower the threshold in merge boxes line 22:

    OverlapMergeThreshold = .15;

to

    OverlapMergeThreshold = .1;  

or

    OverlapMergeThreshold = .05;

For long 22s, we usually want to separate them and automatically run a code to do it. to disable it, comment out SqueakDetect.m Line 180

    Calls = SeperateLong22s_Callback([],[],[],inputfile,Calls);

to

   % Calls = SeperateLong22s_Callback([],[],[],inputfile,Calls);

Let me know if that helps, Kevin

s1782988 commented 5 years ago

Hi Kevin,

Thank you for your reply! I tried this but it didn’t seem to do much for the long 22s. Currently I am exporting to Raven, manually selecting, and then importing back into DeepSqueak with the idea that with enough data, I might be able to train my detector to better identify continuous calls…?

Best, Raven


Raven Hickson PhD student, Kind Lab Centre for Discovery Brain Sciences University of Edinburgh

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.

On 4 Nov 2019, at 22:52, DrCoffey notifications@github.com<mailto:notifications@github.com> wrote:

Hey, I think that is just an old comment, the merge boxes code does run. It has to because if you increase recall with the slider it actually detects the whole image a second time and has to merge overlapping boxes. You could try the following things to increase merging...

Change SpueakDetect.m Line 175 from

Calls = merge_boxes(AllBoxes, AllScores, AllClass, AllPowers, audio_info, 1, score_cuttoff, 0);

to

Calls = merge_boxes(AllBoxes, AllScores, AllClass, AllPowers, audio_info, 1, score_cuttoff, 1);

The 1 will tell the code to enlarge the boxes a little to aid in merging.

or lower the threshold in merge boxes line 22:

OverlapMergeThreshold = .15;

to

OverlapMergeThreshold = .1; or OverlapMergeThreshold = .05;

For long 22s, we usually want to separate them and automatically run a code to do it. to disable it, comment out SqueakDetect.m Line 180

Calls = SeperateLong22s_Callback([],[],[],inputfile,Calls);

to

% Calls = SeperateLong22s_Callback([],[],[],inputfile,Calls);

Let me know if that helps, Kevin

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/DrCoffey/DeepSqueak/issues/62?email_source=notifications&email_token=ALJKTWDC7RYBEBCS5WXR7QTQSCRSFA5CNFSM4JFBWZK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDA7Z6Q#issuecomment-549584122, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALJKTWGTOPEUXWIKUMZEMCLQSCRSFANCNFSM4JFBWZKQ.

DrCoffey commented 5 years ago

It may be easier to write a simple script to merge any call where the Inter-call-interval is less than some threshold.

bgoeckner commented 4 years ago

I am having a similar issue (some 22 kHz rat calls being split into multiple calls -although not necessarily the longer calls). I tried changing code as suggested in the Nov 4 comment, but this did not solve the problem. It has also shifted the identified call start time to before the call appears to begin. I have played with a couple versions of altering some of these lines and not others, and also changing the OverlapMergeThreshold to various numbers, with no luck so far. Wondering if there was ever a resolution to this that worked. Thanks!

DrCoffey commented 4 years ago

If you want to share an audio file with me I can take a closer look at the issue. We are hoping to start a new round of development soon and want to start with more community engagement. We just set up a Gitter so feel free to post there too. It is currently pretty empty, but I will try to invite as many users as possible soon.

bgoeckner commented 4 years ago

Dr. Coffey, I'm sending a link to the most difficult of the files I've been trying to process. I'm seeing two issues among calls: 1) DeepSqueak grabs only part of the call, often, but not limited to, the first part of the call (for ex. calls 6 & 7 among others on this file) 2) DeepSqueak will seemingly separate one call into two calls (for ex. calls 8 & 9). I've had about half our files run smoothly and the other half have at least some of these issues.

I've been using these settings to process: Analysis Length = 0 Chunk Length = 3 Overlap = 2 Freq High = 24 Freq low = 16 Score Threshold = 0 Append = 1

Contour: Tonality = 0.1, Amplitude = 0

Thanks in advance for any help you can give me in getting this resolved! Bryna https://drive.google.com/file/d/17GkNiAHZB-HAe5K-ynndkJoaWwVrnBtf/view?usp=sharing

DrCoffey commented 4 years ago

Ok, I'll take a look when I can. You can also manually correct these issues with the DeepSqueak Screener fork: https://github.com/UEFepilepsyAIVI/DeepSqueak

This feature will be integrated to the main branch in the coming months, but you can try it there for now.

-Kevin

On Wed, Jul 22, 2020 at 5:40 AM bgoeckner notifications@github.com wrote:

Dr. Coffey, I'm sending a link to the most difficult of the files I've been trying to process. I'm seeing two issues among calls: 1) DeepSqueak grabs only part of the call, often, but not limited to, the first part of the call (for ex. calls #6 https://github.com/DrCoffey/DeepSqueak/issues/6 & 7 among others on this file) 2) DeepSqueak will seemingly separate one call into two calls (for ex. calls #8 https://github.com/DrCoffey/DeepSqueak/pull/8 & 9). I've had about half our files run smoothly and the other half have at least some of these issues.

I've been using these settings to process: Analysis Length = 0 Chunk Length = 3 Overlap = 2 Freq High = 24 Freq low = 16 Score Threshold = 0 Append = 1

Contour: Tonality = 0.1, Amplitude = 0

Thanks in advance for any help you can give me in getting this resolved! Bryna

https://drive.google.com/file/d/17GkNiAHZB-HAe5K-ynndkJoaWwVrnBtf/view?usp=sharing http://url

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DrCoffey/DeepSqueak/issues/62#issuecomment-662429452, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJOFGE4EJER2ICRTZLBOJQLR43M27ANCNFSM4JFBWZKQ .

-- Kevin Coffey, Ph.D. Postdoctoral Scholar Psychiatry & Behavioral Science University of Washington School of Medicine mrcoffey [at] uw.edu mrcoffey@uw.edu | (860) 874 5659