{"id":27857334,"url":"https://github.com/rustbas/filetype-prediction","last_synced_at":"2026-05-05T12:31:12.669Z","repository":{"id":290260318,"uuid":"972658128","full_name":"rustbas/filetype-prediction","owner":"rustbas","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-01T14:47:02.000Z","size":1919,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-04T13:18:01.452Z","etag":null,"topics":["binary","c","neural-network","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rustbas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-25T12:48:05.000Z","updated_at":"2025-05-01T14:47:05.000Z","dependencies_parsed_at":"2025-05-04T13:18:12.746Z","dependency_job_id":"4636a8f2-1897-4887-a547-089e5989cce1","html_url":"https://github.com/rustbas/filetype-prediction","commit_stats":null,"previous_names":["rustbas/filetype-prediction"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/rustbas/filetype-prediction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustbas%2Ffiletype-prediction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustbas%2Ffiletype-prediction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustbas%2Ffiletype-prediction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustbas%2Ffiletype-prediction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rustbas","download_url":"https://codeload.github.com/rustbas/filetype-prediction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustbas%2Ffiletype-prediction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32649503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary","c","neural-network","pytorch"],"created_at":"2025-05-04T13:18:00.051Z","updated_at":"2026-05-05T12:31:12.520Z","avatar_url":"https://github.com/rustbas.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Filetype prediction\n\nExample of using neural networks to predict file type by it's signature. \n\n# Description\n\nIdea of project is to estimate how we can predict (by using neural networks) type of file by it's *signature*.\n\n## Signature\n\n1. `malloc` matrix with size 256x256 and set it to zero,\n2. Read file into byte array,\n3. Moving along array, get byte pairs `i` and `j`,\n4. Increase `matrix[i][j]` by one.\n\n# Features\n\n- Using neural networks from `pytorch`,\n- Using `Numpy API` for fast signature calculating,\n\n# Usage\n\n1. Create environment via `conda` or `mamba`,\n\n```console\n$ conda env create -n filetype_prediction \n$ conda activate filetype_prediction\n$ conda install -f environtment.yaml\n```\n\n2. With **activated** environment run `build.sh` to build the module,\n3. Create data directory and needed subdirectories,\n\n```console\n$ mkdir -p data/{wav, pdf} # For example\n```\n\n4. Copy needed files into directories (I used `find` with `-exec` parameter),\n5. Run `jupyter notebook` and run `pipeline.ipynb` notebook,\n6. At the end you can see accuracy.\n\n# Images\n\n## Heatmap example\n\n![Heatmap](assets/heatmaps.png)\n\n## Training curves\n\n![Curves](assets/stats.png)\n\n# References\n\n- Inspiration video: https://youtu.be/AUWxl0WdiNI?si=mklboGVUC-mZ-d1M\n  - Explanation of signatures collecting: https://youtu.be/4bM3Gut1hIk?si=zSGWLHKTKW7bStPb\n- NumPy C-API (Python C extensions): https://youtu.be/45TOazYbedI?si=jykTbnbjcyzTsN0r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustbas%2Ffiletype-prediction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustbas%2Ffiletype-prediction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustbas%2Ffiletype-prediction/lists"}