{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/a-comprehensive-guide-to-bayesian","title":"A Comprehensive guide to Bayesian Convolutional Neural Network with Variational Inference","arxiv_id":"1901.02731","date":"2019-01-08","proceeding":null,"authors":["Kumar Shridhar","Felix Laumann","Marcus Liwicki"],"abstract":"Artificial Neural Networks are connectionist systems that perform a given\ntask by learning on examples without having prior knowledge about the task.\nThis is done by finding an optimal point estimate for the weights in every\nnode. Generally, the network using point estimates as weights perform well with\nlarge datasets, but they fail to express uncertainty in regions with little or\nno data, leading to overconfident decisions.\n  In this paper, Bayesian Convolutional Neural Network (BayesCNN) using\nVariational Inference is proposed, that introduces probability distribution\nover the weights. Furthermore, the proposed BayesCNN architecture is applied to\ntasks like Image Classification, Image Super-Resolution and Generative\nAdversarial Networks. The results are compared to point-estimates based\narchitectures on MNIST, CIFAR-10 and CIFAR-100 datasets for Image\nCLassification task, on BSD300 dataset for Image Super Resolution task and on\nCIFAR10 dataset again for Generative Adversarial Network task.\n  BayesCNN is based on Bayes by Backprop which derives a variational\napproximation to the true posterior. We, therefore, introduce the idea of\napplying two convolutional operations, one for the mean and one for the\nvariance. Our proposed method not only achieves performances equivalent to\nfrequentist inference in identical architectures but also incorporate a\nmeasurement for uncertainties and regularisation. It further eliminates the use\nof dropout in the model. Moreover, we predict how certain the model prediction\nis based on the epistemic and aleatoric uncertainties and empirically show how\nthe uncertainty can decrease, allowing the decisions made by the network to\nbecome more deterministic as the training accuracy increases. Finally, we\npropose ways to prune the Bayesian architecture and to make it more\ncomputational and time effective.","url_abs":"http://arxiv.org/abs/1901.02731v1","url_pdf":"http://arxiv.org/pdf/1901.02731v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"a-comprehensive-guide-to-bayesian","repo_url":"https://github.com/kumar-shridhar/PyTorch-BayesianCNN","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"a-comprehensive-guide-to-bayesian","repo_url":"https://github.com/Anou9531/Bayesian-CNN","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"a-comprehensive-guide-to-bayesian","repo_url":"https://github.com/Neronjust2017/BayesianCNN","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"a-comprehensive-guide-to-bayesian","repo_url":"https://github.com/kumar-shridhar/BayesianConvNet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"a-comprehensive-guide-to-bayesian","repo_url":"https://github.com/liqichen6688/baycnn","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"a-comprehensive-guide-to-bayesian","repo_url":"https://github.com/pankajb64/bayescnn","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"bayesian-inference","task_name":"Bayesian Inference"},{"task_slug":"classification","task_name":"General Classification"},{"task_slug":null,"task_name":"Generative Adversarial Network"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"image-super-resolution","task_name":"Image Super-Resolution"},{"task_slug":"super-resolution","task_name":"Super-Resolution"},{"task_slug":"variational-inference","task_name":"Variational Inference"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[{"method_slug":"dropout","method_name":"Dropout"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1901.02731","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1901.02731"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/liqichen6688/baycnn","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/kumar-shridhar/PyTorch-BayesianCNN","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/kumar-shridhar/BayesianConvNet","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Anou9531/Bayesian-CNN","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Neronjust2017/BayesianCNN","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pankajb64/bayescnn","reach":null}],"summary":{"ran":1,"ran_draft_wrong":3,"unverified":10},"by_repo_kind":{"official":{"samples":7,"ran":0,"repositories":1},"listed":{"samples":7,"ran":4,"repositories":3}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":1,"samples":[{"code_sha256_prefix":"65b687daec914418","entry":"acc","repo":"Anou9531/Bayesian-CNN","repo_kind":"listed","path":"metrics.py","file_url":"https://github.com/Anou9531/Bayesian-CNN/blob/HEAD/metrics.py","link_basis":"plan_row","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"65b687daec914418"}},{"code_sha256_prefix":"aba995b7ba4b1672","entry":"distribution_selector","repo":"pankajb64/bayescnn","repo_kind":"listed","path":"src/bayesiancnn/BBBdistributions.py","file_url":"https://github.com/pankajb64/bayescnn/blob/HEAD/src/bayesiancnn/BBBdistributions.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"aba995b7ba4b1672"}},{"code_sha256_prefix":"dd46eb517cc22519","entry":"get_uncertainty_per_batch","repo":"Anou9531/Bayesian-CNN","repo_kind":"listed","path":"uncertainty_estimation.py","file_url":"https://github.com/Anou9531/Bayesian-CNN/blob/HEAD/uncertainty_estimation.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dd46eb517cc22519"}},{"code_sha256_prefix":"3698e0abeea9d5d0","entry":"get_uncertainty_per_image","repo":"Anou9531/Bayesian-CNN","repo_kind":"listed","path":"uncertainty_estimation.py","file_url":"https://github.com/Anou9531/Bayesian-CNN/blob/HEAD/uncertainty_estimation.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3698e0abeea9d5d0"}},{"code_sha256_prefix":"c4d3857bfdddadee","entry":"calculate_kl","repo":"kumar-shridhar/PyTorch-BayesianCNN","repo_kind":"official","path":"metrics.py","file_url":"https://github.com/kumar-shridhar/PyTorch-BayesianCNN/blob/HEAD/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c4d3857bfdddadee"}},{"code_sha256_prefix":"749608ddd92cebf0","entry":"calculate_kl","repo":"Anou9531/Bayesian-CNN","repo_kind":"listed","path":"metrics.py","file_url":"https://github.com/Anou9531/Bayesian-CNN/blob/HEAD/metrics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"749608ddd92cebf0"}},{"code_sha256_prefix":"62a807882f020f00","entry":"create_synthetic_data","repo":"kumar-shridhar/PyTorch-BayesianCNN","repo_kind":"official","path":"Mixtures/temp_gmm.py","file_url":"https://github.com/kumar-shridhar/PyTorch-BayesianCNN/blob/HEAD/Mixtures/temp_gmm.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"62a807882f020f00"}},{"code_sha256_prefix":"592922a4273cef0d","entry":"get_beta","repo":"kumar-shridhar/PyTorch-BayesianCNN","repo_kind":"official","path":"metrics.py","file_url":"https://github.com/kumar-shridhar/PyTorch-BayesianCNN/blob/HEAD/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"592922a4273cef0d"}},{"code_sha256_prefix":"6b6f997bdbf99918","entry":"get_sample","repo":"kumar-shridhar/PyTorch-BayesianCNN","repo_kind":"official","path":"uncertainty_estimation.py","file_url":"https://github.com/kumar-shridhar/PyTorch-BayesianCNN/blob/HEAD/uncertainty_estimation.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6b6f997bdbf99918"}},{"code_sha256_prefix":"5f72d46f78c57ba0","entry":"initiate_experiment","repo":"kumar-shridhar/PyTorch-BayesianCNN","repo_kind":"official","path":"Mixtures/mixture_experiment.py","file_url":"https://github.com/kumar-shridhar/PyTorch-BayesianCNN/blob/HEAD/Mixtures/mixture_experiment.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5f72d46f78c57ba0"}},{"code_sha256_prefix":"25d66479cebad409","entry":"logmeanexp","repo":"kumar-shridhar/PyTorch-BayesianCNN","repo_kind":"official","path":"utils.py","file_url":"https://github.com/kumar-shridhar/PyTorch-BayesianCNN/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"25d66479cebad409"}},{"code_sha256_prefix":"764cb9125f7ab709","entry":"lr_linear","repo":"Neronjust2017/BayesianCNN","repo_kind":"listed","path":"metrics.py","file_url":"https://github.com/Neronjust2017/BayesianCNN/blob/HEAD/metrics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"764cb9125f7ab709"}},{"code_sha256_prefix":"6c4f18c203fe16d2","entry":"mse","repo":"Neronjust2017/BayesianCNN","repo_kind":"listed","path":"metrics.py","file_url":"https://github.com/Neronjust2017/BayesianCNN/blob/HEAD/metrics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6c4f18c203fe16d2"}},{"code_sha256_prefix":"e622866e75cd2f4d","entry":"print_to_logfile","repo":"kumar-shridhar/PyTorch-BayesianCNN","repo_kind":"official","path":"Mixtures/mixture_experiment.py","file_url":"https://github.com/kumar-shridhar/PyTorch-BayesianCNN/blob/HEAD/Mixtures/mixture_experiment.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e622866e75cd2f4d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}