{"id":13767927,"url":"https://github.com/angelognazzo/Reliable-Trustworthy-AI","last_synced_at":"2025-05-10T23:30:57.691Z","repository":{"id":170594739,"uuid":"587376787","full_name":"angelognazzo/Reliable-Trustworthy-AI","owner":"angelognazzo","description":"Repository for the Reliable and Trustworthy AI course offered in Fall 2022 at ETH Zürich: implementation of DeepPoly, Robustness Analyzer for Deep Neural Networks","archived":false,"fork":false,"pushed_at":"2023-01-10T16:16:56.000Z","size":7168,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-17T03:30:56.883Z","etag":null,"topics":["computer-vision","deep-learning","deep-neural-networks","reliable-ai","robust-machine-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","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/angelognazzo.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}},"created_at":"2023-01-10T15:57:16.000Z","updated_at":"2023-11-10T04:46:18.000Z","dependencies_parsed_at":"2024-01-07T18:17:26.468Z","dependency_job_id":"fc87d1e1-167b-4209-81c8-d9b8efe6dcf6","html_url":"https://github.com/angelognazzo/Reliable-Trustworthy-AI","commit_stats":null,"previous_names":["angelognazzo/reliable-trustworthy-ai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelognazzo%2FReliable-Trustworthy-AI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelognazzo%2FReliable-Trustworthy-AI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelognazzo%2FReliable-Trustworthy-AI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelognazzo%2FReliable-Trustworthy-AI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angelognazzo","download_url":"https://codeload.github.com/angelognazzo/Reliable-Trustworthy-AI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253497296,"owners_count":21917683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["computer-vision","deep-learning","deep-neural-networks","reliable-ai","robust-machine-learning"],"created_at":"2024-08-03T16:01:14.316Z","updated_at":"2025-05-10T23:30:55.729Z","avatar_url":"https://github.com/angelognazzo.png","language":"Python","funding_links":[],"categories":["Education Resources"],"sub_categories":["Open-ish Classes"],"readme":"# ReliableAI 2022 Course Project\n\nThis is the project for Reliable and Trustworthy Artificial Intelligence course at ETH Zurich.\n\n## Folder structure\nIn the directory `code` you can find several files. \nFile `networks.py` and `resnet.py` contain encodings of fully connected, convolutional and residual neural network architectures as PyTorch classes.\nThe architectures extend `nn.Module` object and consist of standard PyTorch layers (e.g. `Linear`, `Flatten`, `ReLU`, `Conv2d`). Please note that first layer of each network performs normalization of the input image. \nFile `verifier.py` contains a template of verifier. Loading of the stored networks and test cases is already implemented in `main` function. If you decide to modify `main` function, please ensure that parsing of the test cases works correctly. Your task is to modify `analyze` function by building upon DeepPoly convex relaxation. Note that provided verifier template is guaranteed to achieve **0** points (by always outputting `not verified`).\n\nIn folder `nets` you can find 10 neural networks (3 fully connected, 4 convolutional, and 3 residual). These networks are loaded using PyTorch in `verifier.py`.\nYou can find architectures of these networks in `networks.py`.\nNote that for ResNet we prepend Normalization layer after loading the network (see `get_net` function in `verifier.py`).\nName of each network contains the dataset the network is trained used on, e.g. `net3_cifar10_fc3.pt` is network which receives CIFAR-10 images as inputs.\nIn folder `examples` you can find 10 subfolders. Each subfolder is associated with one of the 10 networks. In a subfolder corresponding to a network, you can find 2 example test cases for this network. \nAs explained in the lecture, these test cases **are not** part of the set of test cases which we will use for the final evaluation, and they are only here for you to develop your verifier. \n\n## Setup instructions\n\nWe recommend you to install Python virtual environment to ensure dependencies are same as the ones we will use for evaluation.\nTo evaluate your solution, we are going to use Python 3.7.\nYou can create virtual environment and install the dependencies using the following commands:\n\n```bash\n$ virtualenv venv --python=python3.7\n$ source venv/bin/activate\n$ pip install -r requirements.txt\n```\n\n## Running the verifier\n\nWe will run your verifier from `code` directory using the command:\n\n```bash\n$ python verifier.py --net {net} --spec ../examples/{net}/img{test_idx}_{eps}.txt\n```\n\nIn this command, `{net}` is equal to one of the following values (each representing one of the networks we want to verify): `net1, net2, net3, net4, net5, net6, net7, net8, net9, net10`.\n`test_idx` is an integer representing index of the test case, while `eps` is perturbation that verifier should certify in this test case.\n\nTo test your verifier, you can run for example:\n\n```bash\n$ python verifier.py --net net1 --spec ../examples/net1/img1_0.0500.txt\n```\n\nTo evaluate the verifier on all networks and sample test cases, we provide the evaluation script.\nYou can run this script using the following commands:\n\n```bash\nchmod +x evaluate\n./evaluate ../examples\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangelognazzo%2FReliable-Trustworthy-AI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangelognazzo%2FReliable-Trustworthy-AI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangelognazzo%2FReliable-Trustworthy-AI/lists"}