Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeepFlavour Negative Tagger + DeepFlavour 10X training #23467

Merged
merged 4 commits into from Jun 11, 2018

Conversation

emilbols
Copy link
Contributor

@emilbols emilbols commented Jun 4, 2018

This PR is concerned with the implementation of the DeepFlavour negative tagger, which is used for estimating the rate of light jets being tagged as b jets. The goal of the negative tagger is to have the same light jet distribution as the full tagger, but filter out as many b-jets as possible at high discriminator values. This is done by inverting the sign of all distributions that are symmetric under sign inversion for light jets, but not for b-jets.

A description of the negative taggers in general can be found in these presentation at the BTV meeting [1] and at the RECO meeting [2].

The DeepFlavour negative tagger distribution is shown in [3]. The negative tagger discriminator values are shown from -1 to 0, and the full tagger is shown from 0 to 1. Red is b-jets, blue and light blue are light jets, and green is c-jets.

Originally this PR was a part of PR #23206 , but it was filtered out due to merge conflicts. The review comments by @slava77 left in that PR has been dealt with here.

PR #23206 also introduced the 94X training which was made a while back. While that PR was ongoing we produced a 10X training, which performs better, so in this PR we also add a new DeepFlavour model trained on 10X MC samples. It is therefore required that the PR cms-data/RecoBTag-Combined#14 is merged first. The ROC curves can be seen in [4]. Here the dashed line is c vs b and the full line is l vs b.

[1] https://indico.cern.ch/event/713923/contributions/2938152/attachments/1620844/2578707/NegativeTagger.pdf

[2] https://indico.cern.ch/event/732060/contributions/3020340/attachments/1660464/2659922/NegativeTaggerPR.pdf

[3]
deepflavournegativetagger

[4]
rocs

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 4, 2018

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 4, 2018

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-23467/5008

Code check has found code style and quality issues which could be resolved by applying a patch in https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-23467/5008/git-diff.patch
e.g. curl https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-23467/5008/git-diff.patch | patch -p1

You can run scram build code-checks to apply code checks directly

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 4, 2018

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 4, 2018

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 4, 2018

A new Pull Request was created by @emilbols for master.

It involves the following packages:

PhysicsTools/PatAlgos
RecoBTag/TensorFlow

@perrotta, @monttj, @cmsbuild, @slava77, @gpetruc, @arizzi can you please review it and eventually sign? Thanks.
@TaiSakuma, @gouskos, @rappoccio, @imarches, @ahinzmann, @smoortga, @acaudron, @gpetruc, @mmarionncern, @jdamgov, @jdolen, @nhanvtran, @JyothsnaKomaragiri, @gkasieczka, @schoef, @ferencek, @mverzett, @mariadalfonso, @pvmulder, @seemasharmafnal this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@slava77
Copy link
Contributor

slava77 commented Jun 4, 2018

@cmsbuild please test with cms-sw/cmsdist#4084

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 4, 2018

Ignoring test request.
ERROR: Unable to find cmsdist Pull request cms-sw/cmsdist#4084

@slava77
Copy link
Contributor

slava77 commented Jun 4, 2018

@cmsbuild please test with cms-sw/cmsdist#4086

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 4, 2018

The tests are being triggered in jenkins.
Using externals from cms-sw/cmsdist#4086
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/28454/console

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 8, 2018

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 8, 2018

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 8, 2018

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-23467/28558/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 114 differences found in the comparisons
  • DQMHistoTests: Total files compared: 31
  • DQMHistoTests: Total histograms compared: 2902639
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2902447
  • DQMHistoTests: Total skipped: 190
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 30 files compared)
  • Checked 128 log files, 14 edm output root files, 31 DQM output files

@slava77
Copy link
Contributor

slava77 commented Jun 8, 2018

@ferencek @imarches @emilbols
please clarify on the plans to have the MC validation plots for the deepFlavour (ROC curves and such).
It's quite unfortunate that the most powerful tagger has no standard DQM/validation plots.

@slava77
Copy link
Contributor

slava77 commented Jun 8, 2018

Looking at JetHT data both 2016E (wf 135.7611) and 2017F (wf 136.8311) show rather similar changes in all 6 discriminants, except for perhaps probuds [all assignments are assuming I got the index to discriminant conversion right; most of them make sense].

probuds 2017
all_sign1024vsorig_runjetht2017freminiaod136p8311c_min2 max-2 patjets_slimmedjets__pat_obj___pairdiscrivector__24__second

probuds 2016
all_sign1024vsorig_runjetht2016ereminiaodwf136p7611c_min2 max-2 patjets_slimmedjets__pat_obj___pairdiscrivector__24__second

prob b 2017:
all_sign1024vsorig_runjetht2017freminiaod136p8311c_min2 max-2 patjets_slimmedjets__pat_obj___pairdiscrivector__19__second

prob g 2017
all_sign1024vsorig_runjetht2017freminiaod136p8311c_min2 max-2 patjets_slimmedjets__pat_obj___pairdiscrivector__21__second

Compare this to 2017 ttbar MC (wf 1325.51)
prob b
all_sign1024vsorig_ttbar13reminiaodwf1325p51c_min2 max-2 patjets_slimmedjets__pat_obj___pairdiscrivector__19__second

prob g
all_sign1024vsorig_ttbar13reminiaodwf1325p51c_min2 max-2 patjets_slimmedjets__pat_obj___pairdiscrivector__21__second

prob uds
all_sign1024vsorig_ttbar13reminiaodwf1325p51c_min2 max-2 patjets_slimmedjets__pat_obj___pairdiscrivector__24__second

Somewhat superficially, all these changes look like an improvement in performance in line with the ROC curves in [4] in the PR description.

Memory and CPU use didn't change significantly based on wf 136.8311.

@slava77
Copy link
Contributor

slava77 commented Jun 8, 2018

+1

for #23467 b626752

  • code changes are in line with the PR description and the related review
  • jenkins tests pass and comparisons with the baseline show differences only in the miniAOD outputs in the deepFlavour discriminants saved in the slimmedJets
  • local tests using larger samples show roughly expected behavior DeepFlavour Negative Tagger + DeepFlavour 10X training #23467 (comment).

This PR should be integrated together or after cms-sw/cmsdist#4086

@ghost
Copy link

ghost commented Jun 8, 2018

@slava77 next task for Emil is to move DeepFlavour to Reco, as he discussed during the Reco meeting (unfortunately I could not connect, but I was told there was nobody against this plan). This will allow to have DeepFlavour more easily integrated in the standard validation workflow.

@slava77
Copy link
Contributor

slava77 commented Jun 9, 2018 via email

@fabiocos
Copy link
Contributor

+1

@fabiocos
Copy link
Contributor

merge

@cmsbuild cmsbuild merged commit c45eeb5 into cms-sw:master Jun 11, 2018
@emilbols
Copy link
Contributor Author

@slava77 @jmduarte I guess the strategy for backport of this to 94X, will be to wait for the 94X backport of the deepDoubleB Tagger first?

@slava77
Copy link
Contributor

slava77 commented Jun 11, 2018 via email

@swertz
Copy link
Contributor

swertz commented Jun 12, 2018

Are there any present issues to include relevant parts of BTag validation in the @miniAODValidation sequence? IIUC, all necessary products are available at run time and the standard plots can be made

There has been no "standard" miniAOD BTag validation set up since the discriminators in miniAOD are directly copied from RECO and not recomputed. What we've been doing is from time to time manually run a sequence to re-compute the taggers using miniAOD products and check the performance agreement with RECO (not jet-by-jet). We can and will naturally include DeepFlavour into this workflow.

Now, if DeepFlavour is only available in miniAOD it would indeed be good to validate it there too (and we'll add it to the standard validation when it's included in RECO).
About the "miniAODValidation sequence", could you point me to where it's configured? To be clear, we're talking about a sample-vs-sample comparison within miniAOD, not an object-vs-object comparison between miniAOD and REOC?
Also, when is this sequence run? An issue is that the validation uses products that are not available in miniAOD, but maybe these are available when that sequence is run...

@slava77
Copy link
Contributor

slava77 commented Jun 12, 2018 via email

@ghost
Copy link

ghost commented Jun 12, 2018

Hi @slava77 yes, you remember correctly. The next PR we will perform, that will move DeepFlavour to the RECO is indeed removing also the Puppi dependence

@ferencek
Copy link
Contributor

I'm also not very familiar with the miniAOD DQM and Validation sequence but since it is run in the same job as the miniAOD production, all the AOD products should be available which should make it possible to run the standard btag validation with a few tweaks here and there.

As @swertz pointed out, up to now all ak4 btag discriminators were produced in RECO and then stored in miniAOD so there was no strong reason to implement anything in the miniAOD validation sequence. DeepFlavour is now an exception but if it will soon be in RECO, we will be back to the usual situation.

One place where miniAOD validation would be useful is fat jets for which we don't run b tagging in the standard reco.

@@ -209,20 +218,16 @@ void DeepFlavourTagInfoProducer::produce(edm::Event& iEvent, const edm::EventSet
{ return btagbtvdeep::sv_vertex_comparator(sva, svb, pv); });
// fill features from secondary vertices
for (const auto & sv : svs_sorted) {
if (reco::deltaR(sv, jet) > jet_radius_) continue;
if (reco::deltaR2(sv.position() - pv.position(), flip_ ? -jet_dir : jet_dir) > (jet_radius_*jet_radius_)) continue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emilbols
just to keep a record for future references: this change is undone in #23781
Please confirm that this change here was made as a mistake and not as a result of an update to the definitions used for new training.

Copy link
Contributor Author

@emilbols emilbols Jul 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slava77 it was just a mistake. In the training it was always done in the previous way (deltaR calculated with vertex momentum).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants