{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_kg_hide-input":true,"_kg_hide-output":true,"execution":{"iopub.status.busy":"2022-02-17T01:46:30.130517Z","iopub.execute_input":"2022-02-17T01:46:30.131207Z","iopub.status.idle":"2022-02-17T01:46:33.672589Z","shell.execute_reply.started":"2022-02-17T01:46:30.130968Z","shell.execute_reply":"2022-02-17T01:46:33.671565Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<center style=\"font-family:verdana;\"><h1 style=\"font-size:200%; padding: 10px; background: green;\"><b style=\"color:orange;\">Hawaii and Avian Loss</b></h1></center>\n\n\"Called “The Extinction Capital of the World,” Hawaii has experienced far more avian loss than the other 49 states combined.\n\n\"Using the fossil record, scientists have identified at least 71 species and subspecies of forest birds — along with several duck, goose, rail, and flightless ibis species — that disappeared following the arrival of the Polynesians 800 to 1,400 years ago. Some were likely hunted directly, scientists believe, whereas others were done in by habitat degradation or by the rats, pigs, and dogs that the Polynesians brought with them.\"\n\n\"Once Europeans arrived in 1778, a second wave of destruction commenced, leading to 24 additional bird extinctions (plus the unceremonious overthrow of the Hawaiian monarchy). In addition to accelerating habitat loss, Europeans and Americans introduced new and deadly avian predators, from cats and mongooses to the black rat, which, unlike the Polynesian rat, readily climbs trees to raid nests.\"\n\n\"Today, only 21 native songbird species remain on the main Hawaiian islands, 11 of which are federally listed as endangered. Most are high in the mountains, where avian malaria has yet to reach, meaning locals in the populated lowlands can spend their entire lives without ever seeing a native passerine.\"\n\nhttps://www.birdwatchingdaily.com/news/conservation/hawaii-epicenter-avian-extinction-crisis/","metadata":{}},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:green;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:orange; padding:10px\">Collapsing avian community on a Hawaiian island</span></h1><br>\n\n\nAuthors: EBEN H. PAXTON RICHARD J. CAMP. MARCOS GORRESENLISA H. CRAMPTON L. LEONARD JR.AND ERIC A. VANDERWERF\n\n7 Sep 2016 • Vol 2, Issue 9 • DOI: 10.1126/sciadv.1600029\n\nhttps://www.science.org/doi/10.1126/sciadv.1600029\n\n![](https://www.science.org/cms/10.1126/sciadv.1600029/asset/a36a2df6-d0ca-42ce-8e81-35647eff2c7c/assets/graphic/1600029-f1b.jpeg)science.org","metadata":{}},{"cell_type":"code","source":"# Other  \nimport librosa\nimport librosa.display\nimport json\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\nfrom matplotlib.pyplot import specgram\nimport pandas as pd\nimport seaborn as sns\nimport glob \nimport os\nfrom tqdm import tqdm\nimport pickle\nimport IPython.display as ipd  # To play sound in the notebook","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Bye Bye Librosa. Fairwell.  We're working with OGGs files ","metadata":{}},{"cell_type":"markdown","source":"#Audio/spectogram by Sayantan Mazumdar https://www.kaggle.com/swaralipibose/converting-audio-to-spectogram-noise-image-data/notebook","metadata":{}},{"cell_type":"code","source":"#Code by Sayantan Mazumdar https://www.kaggle.com/swaralipibose/converting-audio-to-spectogram-noise-image-data/notebook\n\n!pip install soundfile","metadata":{"_kg_hide-output":true,"execution":{"iopub.status.busy":"2022-02-17T01:46:48.499537Z","iopub.execute_input":"2022-02-17T01:46:48.499834Z","iopub.status.idle":"2022-02-17T01:46:57.722712Z","shell.execute_reply.started":"2022-02-17T01:46:48.499803Z","shell.execute_reply":"2022-02-17T01:46:57.721512Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Eight Hawaii birds among nearly two dozen extinct species\n\nBy Matthew Brown Associated Press Sept. 30, 2021\n\n\"The most recent to go extinct was the teeny po‘ouli, a type of bird known as a honeycreeper discovered in 1973.\"\n\n\"By the late 1990s just three remained — a male and two females. After failures to mate them in the wild, the male was captured for potential breeding and died in 2004. The two females were never seen again.\"\n\n\"The other Hawaiian birds are the Kauai ‘akialoa, Kauai nukupu‘u, large Kauai thrush, Maui ‘akepa, Maui nukupu‘u and the Molokai creeper.\"\n\n\"Many of the species being proposed for delisting were already extremely rare or uncommon when discovered or when they were federally listed. Some like the Kaua‘i nukupu‘u had not been seen since 1899 and weren’t able to benefit from the conservation protections of the Endangered Species Act (ESA), according to the U.S. Fish and Wildlife Service.\"\n\nhttps://www.staradvertiser.com/2021/09/30/hawaii-news/u-s-says-8-isle-birds-among-nearly-two-dozen-extinct-species/","metadata":{}},{"cell_type":"code","source":"#Code by Sayantan Mazumdar https://www.kaggle.com/swaralipibose/converting-audio-to-spectogram-noise-image-data/notebook\n\n!pip install noisereduce","metadata":{"_kg_hide-output":true,"execution":{"iopub.status.busy":"2022-02-17T01:47:03.429628Z","iopub.execute_input":"2022-02-17T01:47:03.430041Z","iopub.status.idle":"2022-02-17T01:47:12.677905Z","shell.execute_reply.started":"2022-02-17T01:47:03.430003Z","shell.execute_reply":"2022-02-17T01:47:12.677004Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Sayantan Mazumdar https://www.kaggle.com/swaralipibose/converting-audio-to-spectogram-noise-image-data/notebook\n\n#Convert Audio to Frequency\n\nimport soundfile as sf\nfreq,rate=sf.read('../input/birdclef-2022/train_audio/kauama/XC27334.ogg')\nimport plotly.express as px\nimport numpy as np\npx.line(x=np.array(list(range(len(freq)))),y=freq)","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-02-17T01:50:58.428543Z","iopub.execute_input":"2022-02-17T01:50:58.428857Z","iopub.status.idle":"2022-02-17T01:51:04.668092Z","shell.execute_reply.started":"2022-02-17T01:50:58.428827Z","shell.execute_reply":"2022-02-17T01:51:04.666726Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#List of extinct Birds of the Hawaiian Islands\n\nPre-European extinctions (before 1778)\n\nThe moa-nalo\n\nApteribis, Maui and Molokai, 200,000 years ago\n\nGiant amakihi, Hawaii, 1000 BC\n\nGiant Hawaii goose, Hawaii, 7000 BC\n\nGreat Maui crake, Maui, the 13th century AD\n\nHigh-billed crow, Maui, circa AD 1000\n\nKauaʻi finch, Kauaʻi and Oʻahu, Hawaii, the early 16th century AD\n\nKauaʻi mole duck, Kauaʻi, 4050 BC\n\nKauaʻi palila, Kauaʻi, unknown\n\nMaui Nui finch, Maui and Molokaʻi, Hawaii, the early 12th century AD\n\nMoa-nalo, Hawaii, the 11th century AD\n\nNēnē-nui, Hawaii, 6000 BC\n\nOʻahu grosbeak, Oʻahu and Maui, Hawaii, 7000 BC\n\nOʻahu petrel, Hawaii, 6000 BC\n\nPrimitive koa-finch, Oʻahu and Maui, Hawaii, before 1778\n\nScissor-billed koa-finch fossils on Kauaʻi, and Maui, Hawaii, unknown\n\nStilt-owls (Grallistrix spp.) circa AD 1000\n\nStout-legged finch, Kauaʻi, Hawaii, unknown\n\nWood harrier, Maui and Molokai, unknown\n\nhttps://en.wikipedia.org/wiki/List_of_extinct_animals_of_the_Hawaiian_Islands","metadata":{}},{"cell_type":"code","source":"#Code by Sayantan Mazumdar https://www.kaggle.com/swaralipibose/converting-audio-to-spectogram-noise-image-data/notebook\n\nimport IPython\nIPython.display.Audio(\"../input/birdclef-2022/train_audio/kauama/XC27334.ogg\")","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-02-17T01:51:18.819375Z","iopub.execute_input":"2022-02-17T01:51:18.820233Z","iopub.status.idle":"2022-02-17T01:51:18.838053Z","shell.execute_reply.started":"2022-02-17T01:51:18.820187Z","shell.execute_reply":"2022-02-17T01:51:18.836306Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"\"You'll discover that no place on Earth is home to more bird species under threat of extinction. In fact, Hawai‘i is the bird extinction capital of the world.\"\n\n\"Since humans arrived, 95 of 142 bird species found nowhere else have become extinct on Hawai'i. Thirty-three of Hawai‘i's remaining 44 endemic birds are listed under the Endangered Species Act; 11 of those have not been seen for decades and are likely extinct.\"\n\n\"Remaining birds such as the ‘Akikiki, ‘I‘iwi, and Kiwikiu face multiple threats, ranging from loss of their feeding and nesting areas to direct predation by invasive species. Mosquito-borne diseases have further decimated populations of Hawaiian birds. Many of these birds are highly susceptible to non-native diseases such as avian malaria and pox, carried and spread by introduced mosquitoes.\"\n\nhttps://abcbirds.org/program/hawaii/","metadata":{}},{"cell_type":"code","source":"#Code by Sayantan Mazumdar https://www.kaggle.com/swaralipibose/converting-audio-to-spectogram-noise-image-data/notebook\n\n!pip install tensorflow-io","metadata":{"_kg_hide-output":true,"execution":{"iopub.status.busy":"2022-02-17T01:51:30.261315Z","iopub.execute_input":"2022-02-17T01:51:30.262397Z","iopub.status.idle":"2022-02-17T01:51:39.417075Z","shell.execute_reply.started":"2022-02-17T01:51:30.262308Z","shell.execute_reply":"2022-02-17T01:51:39.415929Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">The last time we heard their Song</span></h1><br>\n\n\"On an early morning in 1975, H. Douglas Pratt awoke in his tent pitched on Hawaii’s Alakaʻi Plateau to the song of the Kauaʻi ʻŌʻō. The bell-like vocal clarity was unmistakable, though the bird was extremely rare; the species was listed as federally endangered in 1973, with an estimated population of 36 surviving individuals.\n\n“I can still recall the hair standing up on my neck,” the retired ornithologist says. “Their song can be described as both haunting and evocative.”\n\n\"Pratt was lucky to hear the Kauaʻi ʻŌʻō, and was one of the last people to do so. The mostly black bird with tufts of striking yellow feathers on its thighs was last seen in 1985 and last heard in 1987. No one will ever hear it sing in the wild again.\"\n\n\"The U.S. Fish and Wildlife Service (USFWS) declared 23 species across the United States extinct and proposed they lose protections under the Endangered Species Act (ESA). Eight of those species, including the Kauaʻi ʻŌʻō, are Hawaii forest birds. The other seven are the Kauaʻi ʻAkialoa, Kauaʻi Nukupuʻu, Kāmaʻo or Large Kauaʻi Thrush, Maui Ākepa, Maui Nukupuʻu, Kākāwahie or Molokai Creeper, and Poʻouli. The Ivory-billed Woodpecker and Bachmann’s Warbler are also extinct, according to the agency.\"\n\nhttps://www.audubon.org/news/wave-hawaiian-bird-extinctions-stresses-islands-conservation-crisis","metadata":{}},{"cell_type":"markdown","source":"<iframe width=\"942\" height=\"530\" src=\"https://www.youtube.com/embed/LrcCK2zERdM\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>","metadata":{}},{"cell_type":"markdown","source":"#Kaua‘i ‘Ō‘ō Song\n\n\"The haunting song of the Kaua‘i ‘Ō‘ō will never be heard in the wild again. Although listed as endangered by the U.S. Fish and Wildlife Service, it has not been detected since 1987, and the IUCN Red List of Threatened Species lists it as extinct.\"\n\n\"Habitat destruction and invasive species were the likely causes of the species' decline and loss.\"\n\n\"Audio provided by the Macaulay Library at the Cornell Lab of Ornithology\"\n\n\"Audio recorded by Robert J. Shallenberger.\"\n\nhttps://www.youtube.com/watch?v=LrcCK2zERdM","metadata":{}},{"cell_type":"markdown","source":"![](https://i.ytimg.com/vi/mfwCxfIPwcY/maxresdefault.jpg)youtube.com","metadata":{}},{"cell_type":"code","source":"#Code by Sayantan Mazumdar https://www.kaggle.com/swaralipibose/converting-audio-to-spectogram-noise-image-data/notebook\n\nimport tensorflow_io as tfio","metadata":{"execution":{"iopub.status.busy":"2022-02-17T01:51:49.406611Z","iopub.execute_input":"2022-02-17T01:51:49.407025Z","iopub.status.idle":"2022-02-17T01:51:52.042002Z","shell.execute_reply.started":"2022-02-17T01:51:49.406989Z","shell.execute_reply":"2022-02-17T01:51:52.040942Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Post-European extinctions (1778)\n\nĀmaui - the 1850s - Oahu\n\nBishop's ʻōʻō - 1904 - Molokai and Maui\n\nBlack mamo - 1907 - Molokai and Maui\n\nGreater ʻamakihi - 1901 - Hawaii/the Big Island\n\nGreater koa finch - 1896 - Hawaii/the Big Island\n\nHawaiʻi ʻakialoa - 1940 - Hawaii/the Big Island\n\nHawai'i mamo - July 1898 - the Hawaiian Islands\n\nHawaiʻi ʻōʻō  - 1934 - Hawaii/the Big Island\n\nHawaiian rail - 1883 - Hawaii/the Big Island\n\nKāmaʻo - 1989 - Kauaʻi\n\nKauaʻi ʻakialoa - 1965 - Kauaʻi\n\nKauaʻi ʻōʻō - 1987 - Kauaʻi\n\nKioea - 1859 - Hawaii/the Big Island\n\nLanaʻi 'akialoa - the 1890's - Lanaʻi\n\nKona grosbeak - 1894 - Hawaii/the Big Island\n\nLānaʻi hookbill - 1918 - Lānaʻi\n\nLaysan rail - 1944 - Laysan\n\nLaysan honeycreeper - 1923 - Laysan\n\nLaysan millerbird  - the 1910's - Laysan\n\nLesser koa finch - 1891 - Hawaii/the Big Island\n\nMaui ʻakepa - 1988 - M'aui\n\nMolokaʻi creeper - 1963 - Molokaʻi\n\nOʻahu ʻōʻō - 1837 - O‘ahu\n\nOahu 'akialoa - The 1860s-1940 - O‘ahu\n\nOʻahu ʻakepa - The 1900s - Oʻahu\n\nOʻahu nukupuʻu - 1837 - O‘ahu\n\nUla-'ai-hawane - 1892 - Hawaii/the Big Island\n\nPoʻouli - 1984 - November 26, 2004 - Maui\n\nhttps://en.wikipedia.org/wiki/List_of_extinct_animals_of_the_Hawaiian_Islands","metadata":{}},{"cell_type":"code","source":"#Code by Sayantan Mazumdar https://www.kaggle.com/swaralipibose/converting-audio-to-spectogram-noise-image-data/notebook\n\nimport tensorflow as tf","metadata":{"execution":{"iopub.status.busy":"2022-02-17T01:52:00.135691Z","iopub.execute_input":"2022-02-17T01:52:00.136005Z","iopub.status.idle":"2022-02-17T01:52:00.141072Z","shell.execute_reply.started":"2022-02-17T01:52:00.135973Z","shell.execute_reply":"2022-02-17T01:52:00.140219Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Reasons to Extinction\n\nDestruction of forest habitat, invasive predators, and avian malaria, a mosquito-borne disease introduced to the Islands within the last few centuries.\n\nhttps://www.audubon.org/news/wave-hawaiian-bird-extinctions-stresses-islands-conservation-crisis","metadata":{}},{"cell_type":"code","source":"import noisereduce as nr\nreduced_noise=nr.reduce_noise(y=freq,sr=rate)","metadata":{"execution":{"iopub.status.busy":"2022-02-17T01:53:56.224945Z","iopub.execute_input":"2022-02-17T01:53:56.225275Z","iopub.status.idle":"2022-02-17T01:53:56.578850Z","shell.execute_reply.started":"2022-02-17T01:53:56.225239Z","shell.execute_reply":"2022-02-17T01:53:56.577522Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Convert an ogg file to spectogram","metadata":{}},{"cell_type":"code","source":"#Code by Sayantan Mazumdar https://www.kaggle.com/swaralipibose/converting-audio-to-spectogram-noise-image-data/notebook\n\ndef read(pth,reduce_noise):\n    freq,rate=sf.read(pth)\n    if reduce_noise:\n        freq=nr.reduce_noise(y=freq,sr=rate)\n    # Convert to spectrogram\n    spectrogram = tfio.audio.spectrogram(\n    reduced_noise, nfft=3600, window=256, stride=256)\n    return tf.math.log(spectrogram).numpy()\nplt.imshow(read('../input/birdclef-2022/train_audio/kauama/XC27334.ogg',True));","metadata":{"_kg_hide-output":false,"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-02-17T01:54:26.207220Z","iopub.execute_input":"2022-02-17T01:54:26.208420Z","iopub.status.idle":"2022-02-17T01:54:30.032954Z","shell.execute_reply.started":"2022-02-17T01:54:26.208349Z","shell.execute_reply":"2022-02-17T01:54:30.032335Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import seaborn as sns\nimport plotly.express as px\nimport plotly.graph_objs as go\n\n#Ignore warnings\nimport warnings\nwarnings.filterwarnings('ignore')","metadata":{"execution":{"iopub.status.busy":"2022-02-17T01:54:38.901138Z","iopub.execute_input":"2022-02-17T01:54:38.902158Z","iopub.status.idle":"2022-02-17T01:54:38.907171Z","shell.execute_reply.started":"2022-02-17T01:54:38.902108Z","shell.execute_reply":"2022-02-17T01:54:38.905923Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"eBird = pd.read_csv(\"/kaggle/input/birdclef-2022/eBird_Taxonomy_v2021.csv\")\npd.set_option('display.max_columns', None)\neBird.head()","metadata":{"execution":{"iopub.status.busy":"2022-02-17T01:54:43.840764Z","iopub.execute_input":"2022-02-17T01:54:43.841086Z","iopub.status.idle":"2022-02-17T01:54:43.922101Z","shell.execute_reply.started":"2022-02-17T01:54:43.841052Z","shell.execute_reply":"2022-02-17T01:54:43.921176Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:green;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:orange; padding:10px\">Taxonomic Ranks</span></h1><br>\n\nThere are seven main taxonomic ranks:\n\nKingdom,\n\nPhylum or division,\n\nClass,\n\nOrder,\n\nFamily,\n\nGenus,\n\nSpecies.\n\nhttps://en.wikipedia.org/wiki/Taxonomic_rank","metadata":{}},{"cell_type":"code","source":"ax = eBird['ORDER1'].value_counts()[:20].plot.barh(figsize=(16, 8), color='green')\nax.set_title('Hawaiian Species Order 1', size=18, color='orange')\nax.set_ylabel('Order 1', size=10)\nax.set_xlabel('Count', size=10);","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-02-17T01:55:17.491318Z","iopub.execute_input":"2022-02-17T01:55:17.491733Z","iopub.status.idle":"2022-02-17T01:55:17.894346Z","shell.execute_reply.started":"2022-02-17T01:55:17.491694Z","shell.execute_reply":"2022-02-17T01:55:17.893369Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#I'iwi","metadata":{}},{"cell_type":"markdown","source":"![](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSrgHGmTagaWoY3cMQ5Eci7tK_58GH2zco3sg&usqp=CAU)abcbirds.salsalabs.org","metadata":{}},{"cell_type":"code","source":"text_cols = ['SPECIES_CODE', 'SCI_NAME', 'ORDER1', 'FAMILY']\n\nfrom wordcloud import WordCloud, STOPWORDS\n\nwc = WordCloud(stopwords = set(list(STOPWORDS) + ['|']), random_state = 42, background_color='orange', colormap=\"Purples\")\nfig, axes = plt.subplots(2, 2, figsize=(20, 12))\naxes = [ax for axes_row in axes for ax in axes_row]\n\nfor i, c in enumerate(text_cols):\n  op = wc.generate(str(eBird[c]))\n  _ = axes[i].imshow(op)\n  _ = axes[i].set_title(c.upper(), fontsize=24)\n  _ = axes[i].axis('off')","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-02-17T01:55:31.939909Z","iopub.execute_input":"2022-02-17T01:55:31.940240Z","iopub.status.idle":"2022-02-17T01:55:33.005063Z","shell.execute_reply.started":"2022-02-17T01:55:31.940205Z","shell.execute_reply":"2022-02-17T01:55:33.004022Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"meta = pd.read_csv(\"/kaggle/input/birdclef-2022/train_metadata.csv\", encoding='utf8')\npd.set_option('display.max_columns', None)\nmeta.head()","metadata":{"execution":{"iopub.status.busy":"2022-02-17T01:55:40.160578Z","iopub.execute_input":"2022-02-17T01:55:40.161784Z","iopub.status.idle":"2022-02-17T01:55:40.282471Z","shell.execute_reply.started":"2022-02-17T01:55:40.161718Z","shell.execute_reply":"2022-02-17T01:55:40.280990Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ax = eBird['CATEGORY'].value_counts()[:20].plot.barh(figsize=(16, 8), color='orange')\nax.set_title('Hawaiian Species Category', size=18, color='green')\nax.set_ylabel('Category', size=10)\nax.set_xlabel('Count', size=10);","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-02-17T01:55:47.596346Z","iopub.execute_input":"2022-02-17T01:55:47.597483Z","iopub.status.idle":"2022-02-17T01:55:47.861364Z","shell.execute_reply.started":"2022-02-17T01:55:47.597419Z","shell.execute_reply":"2022-02-17T01:55:47.860528Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#The band-rumped storm petrel: Hydrobates castro\n\n\"The band-rumped storm petrel, Madeiran storm petrel, or Harcourt's storm petrel (Hydrobates castro) is of the storm petrel family Hydrobatidae.\"\n\n\"The species breeds on islands in the warmer parts of the Atlantic and Pacific Oceans. These include the Berlengas (a few tens of kilometres off mainland Portugal), the Azores, Madeira, Canary Islands and Saint Helena in the Atlantic, and in the Pacific off eastern Japan, on Kauai, Hawaii, and on the Galápagos Islands. In 2018, the species was reported to have also started breeding on the Mauna Loa volcano on the island of Hawaii.\"\n\nTaxonomy\n\n\"Recent discoveries of 'cold season' and 'warm season' populations, which use the same nest sites at different times of year, and also differ in terms of vocalisations and moulting period, may hint at the existence of two 'cryptic species' within the currently understood limits of the species.\"\n\n\"It was formerly defined in the genus Oceanodroma before that genus was synonymized with Hydrobates.\"\n\nhttps://en.wikipedia.org/wiki/Band-rumped_storm_petrel","metadata":{}},{"cell_type":"code","source":"ax = eBird['FAMILY'].value_counts()[:20].plot.barh(figsize=(16, 8), color='purple')\nax.set_title('Hawaiian Species Family', size=18, color='red')\nax.set_ylabel('Family', size=10)\nax.set_xlabel('Count', size=10);","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-02-17T01:56:00.912177Z","iopub.execute_input":"2022-02-17T01:56:00.912534Z","iopub.status.idle":"2022-02-17T01:56:01.335387Z","shell.execute_reply.started":"2022-02-17T01:56:00.912497Z","shell.execute_reply":"2022-02-17T01:56:01.334460Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Varshini PJ  user: varshinipj\n\nfig = px.scatter_mapbox(meta,\n# Here, plotly gets, (x,y) coordinates\nlat=\"latitude\",\nlon=\"longitude\",\ntext='scientific_name',\n\n                #Here, plotly detects color of series\n                size=\"rating\", #numerical attribute to quantify\n                color = \"common_name\", #categorical attribute to classify the data points on the map according to the class of that categorical attribute\n                labels=\"scientific_name\",\n\n                zoom=14.5,\n                center={\"lat\":30.1501, \"lon\":-15.8667},\n                height=600,\n                width=800)\nfig.update_layout(mapbox_style='stamen-terrain')\nfig.update_layout(margin={\"r\": 0, \"t\": 0, \"l\": 0, \"b\": 0})\nfig.update_layout(title_text=\"The band-rumped storm petrel: Hydrobates castro\")\nfig.show()","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2022-02-17T01:56:13.813493Z","iopub.execute_input":"2022-02-17T01:56:13.813804Z","iopub.status.idle":"2022-02-17T01:56:14.870856Z","shell.execute_reply.started":"2022-02-17T01:56:13.813767Z","shell.execute_reply":"2022-02-17T01:56:14.869686Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"json = pd.read_json('../input/birdclef-2022/scored_birds.json', encoding='ISO-8859-2')\njson.head()","metadata":{"execution":{"iopub.status.busy":"2022-02-17T01:56:27.335940Z","iopub.execute_input":"2022-02-17T01:56:27.336965Z","iopub.status.idle":"2022-02-17T01:56:27.354423Z","shell.execute_reply.started":"2022-02-17T01:56:27.336874Z","shell.execute_reply":"2022-02-17T01:56:27.353306Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Acknowledgement:\n\nSayantan Mazumdar https://www.kaggle.com/swaralipibose/converting-audio-to-spectogram-noise-image-data/notebook\n\nVarshini PJ  user: varshinipj","metadata":{}},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:green;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:orange; padding:10px\">Preventing the extinction of other species on our watch</span></h1><br>\n\n\"If scientists can achieve that rapid timeline, they could get to the birds just in time. “We have two to five years to break the extinction cycle,”  “We have the science. We need to scale it up. But I am incredibly hopeful that we can prevent the extinction of another species on our watch.”\n\nhttps://www.audubon.org/news/wave-hawaiian-bird-extinctions-stresses-islands-conservation-crisis","metadata":{}}]}