├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── images
├── freeform_examples.png
└── splicing_illustration.png
└── load_physical_concepts_dataset.ipynb
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # Distribution / packaging
7 | .Python
8 | build/
9 | develop-eggs/
10 | dist/
11 | downloads/
12 | eggs/
13 | .eggs/
14 | lib/
15 | lib64/
16 | parts/
17 | sdist/
18 | var/
19 | wheels/
20 | share/python-wheels/
21 | *.egg-info/
22 | .installed.cfg
23 | *.egg
24 | MANIFEST
25 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How to Contribute
2 |
3 | # Pull Requests
4 |
5 | Please send in fixes or feature additions through Pull Requests.
6 |
7 | ## Contributor License Agreement
8 |
9 | Contributions to this project must be accompanied by a Contributor License
10 | Agreement. You (or your employer) retain the copyright to your contribution,
11 | this simply gives us permission to use and redistribute your contributions as
12 | part of the project. Head over to to see
13 | your current agreements on file or to sign a new one.
14 |
15 | You generally only need to submit a CLA once, so if you've already submitted one
16 | (even if it was for a different project), you probably don't need to do it
17 | again.
18 |
19 | ## Code reviews
20 |
21 | All submissions, including submissions by project members, require review. We
22 | use GitHub pull requests for this purpose. Consult
23 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
24 | information on using pull requests.
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Physical Concepts Dataset
2 |
3 |
4 | The Physical Concepts Dataset is a dataset for learning and evaluating intuitive physics inspired by developmental psychology.
5 |
6 | See this [Colaboratory notebook](https://colab.research.google.com/github/deepmind/physical_concepts/blob/main/load_physical_concepts_dataset.ipynb) for details on how to load the dataset. [](https://colab.research.google.com/github/deepmind/physical_concepts/blob/main/load_physical_concepts_dataset.ipynb)
7 |
8 | The data is available via [Physical Concepts GCP bucket](https://console.cloud.google.com/storage/browser/physical_concepts).
9 |
10 | ## Dataset Categories
11 |
12 | 1. The `freeform` category contains videos of unstructured physical events such as collisions. It contains a training set (300,000 videos) and a test set (5,000 videos). The freeform dataset is suitable for training a model.
13 |
14 | 2. The `probe` category contains five datasets designed to probe one of the five physical concepts listed below. These probes are inspired by the Violation-of-Expectation paradigm in developmental psychology. Each probe dataset consists of 5,000 `probe quadruplets`. Each quadruplet consists of four videos. The probe datasets are not necessarily suitable for training a model.
15 | - Continuity
16 | - Solidity
17 | - Object Persistence
18 | - "Unchangeablesness"
19 | - Directional Inertia
20 |
21 | ### Data Format
22 |
23 | For all datasets, the data consist of videos spanning 15 frames and rendered at a resolution of 64x64 pixels with 3 RGB channels. Each video contains the following keys:
24 | * `image`: rendered image `(shape: 15, 64, 64, 3)`
25 | * `mask`: object segmentation mask `(shape: 15, 64, 64)`
26 | * `camera_pose`: camera orientation and position per frame specified as 6 values `(shape: 15, 6)`:
27 | * lookat (x, y, z)
28 | * distance
29 | * azimuth
30 | * elevation
31 |
32 | NOTE: The probe datasets make the above keys available as `possible_*` and `impossible_*` e.g. `possible_image` or `possible_mask`.
33 |
34 | ## Freeform Dataset
35 |
36 | This dataset is designed to encompass a wide range of complex physical interactions and includes the following events as basic building blocks. Each scene is formed by combined two to four of these building blocks:
37 |
38 | * rolling
39 | * collisions along the ground plane
40 | * collisions from throwing or dropping an object
41 | * occlusions (via a "curtain" that descends from the top of the screen and retracts)
42 | * object stacks
43 | * covering interactions (an open-bottom, closed-top container falls onto an object)
44 | * containment events (an object falls into an open-top container)
45 |
46 | ### Primitive shapes:
47 | * rectangular prism
48 | * sphere
49 |
50 | ### Composite shapes:
51 | * "curtain"
52 | * ramp
53 | * arch
54 | * open-top container
55 | * open bottom contain
56 | We restrict the primitive shapes in our dataset to rectangular prisms and spheres. From the rectangular prisms we build a "curtain," a ramp, an arch, and both open-top and closed-top cont
57 |
58 | ### Object properties:
59 | * sizes were chosen in a hand-crafted range to ensure that objects were visible
60 | * colors and the checkerboard floor were chosen as random RGB values
61 | * Objects had varying but stereotyped masses:
62 | * rolled objects and objects in an object stack had a mass of 10.
63 | * dropped or thrown objects were made 4 times heavier so that they could more easily displace objects they hit.
64 | * Containers had a mass of 4 or 5.
65 | * Arches had a total mass of 60 to keep them upright.
66 |
67 | ## Physical Concept Probes
68 |
69 | These probes were inspired by the violation-of-expectation paradigm for probing intuitive physics knowledge in infants. The basic idea is to measure surprise (the violation of an expectation) on two types of scenes: physically possible scenes and physically impossible scenes. If an agent is consistently more surprised by impossible physics, then that is taken as evidence of acquisition of the physical concept in question.
70 |
71 | One natural concern is that differences in the static visual content of the possible and impossible scenes is responsible for the difference in surprise. To eliminate this possibility, we generate our probe dataset as `probe quadruplets`. These consist of two physically possible scenes and two physically impossible scenes. The physically possible scenes contain similar visual content. To form the physically impossible probes, we swap a segment (see image below) from the first physically possible probe with a segment from the second physically possible probe. The end result is that the probes contain the two possible probes contain the same exact images as the impossible probes -- the only difference is the order of the frames.
72 |
73 |
74 |
75 | Below we briefly describe the logic underpinning the different physical concept probes, but we strongly encourage readers to read the accompanying manuscript to fully understand what these probes are actually testing.
76 |
77 |
78 | ### Object Persistence
79 |
80 | Perhaps the most fundamental aspect of intuitive physics is understanding that objects cannot disappear from existence, and is often called 'object persistence" (or "permanence"). Taking inspiration from a classic behavioral experiment [[1]](#1), probes for this category involve a rigid plank falling on an object. In the possible probe, when the plank falls on the object, the plank occludes it while also remaining propped up by it as expected. By contrast, in the impossible probe the plank falls on top of the object (in a manner that is initially identical) but ends up flat on the floor, as if the object had disappeared. In the counterbalanced probes, the possible probe has the plank falling flat on the floor in an otherwise empty scene, and the impossible probe has the plank falling in the same empty scene but ends up inexplicably propped up by an item that is made to appear under the plank while it occludes part of the floor.
81 |
82 |
83 | ### Unchangeableness
84 |
85 | By the principle of "Unchangeableness" [[2]](#2), objects tend to retain their features (e.g., color, shape) over time. In the possible probes of this dataset, a random assortment of static objects are aligned in the foreground. A screen is lowered in front of those objects, and is then raised. The concept of 'unchangeableness' relates to a number of different aspects of objects, and therefore in the impossible probes we swap the positions of objects when they are behind the curtain to suggest their position, color, or shape has changed.
86 |
87 | ### Continuity
88 |
89 | The concept that an object traces out one continuous path through space and time is referred to in the developmental literature as "continuity" [[3]](#3). For videos in this category we use a nearly identical setup to a classic experiment [[4]](#4) where possible probes begin with two static pillars separated by a gap. A ball is rolled horizontally behind both pillars so that it is visible before, between, and after the pillars during its trajectory. In the impossible probes, while the ball is occluded by the first pillar, the ball is made invisible for the period when it would be between the pillars, and then reappears after the second pillar. Alternatively, we make the ball only visible when it is rolling between the pillars, but not before or after. Note: the splicing procedure for probes for this concept deviates slightly from what is shown above. However, we still maintain the image-level and pairwise matching of frames across possible and impossible videos in a probe tuple.
90 |
91 | ### Solidity
92 |
93 | This dataset is a recreation of an experiment that uses an object and an occluder [[5]](#5) to test understanding of the solidity of objects, as related to the penetration of an object through a container and the ground below. In probes, perspective is carefully controlled such that the camera can view inside the top of the container but not the bottom. In possible probes a rectangular block is dropped into the container and comes to rest as expected. In the impossible probes, the object "falls through" the container and the floor, and therefore disappears from view (with the penetration itself occluded by the face of the container) even if the object should remain visible due to its height. Alternatively, the object remains visible when its height clearly dictates it should fall further into the container. As this involves judging the relative heights of the object and the occluder from memory, we expect this to be quite a challenging dataset.
94 |
95 | ### Directional Inertia
96 |
97 | This dataset is an adaptation of a paradigm developed by Spelke et al [[6]](#6) for investigating infant knowledge of inertia. Where the classic paradigm investigated both magnitude and directional violations of the principle of inertia, the current probe only tests the directional component. Possible probes were formed by rolling a ball at an angle towards a heavy block. Upon contact, the sphere rolled away from the block while reflecting it's velocity about the angle of incidence (as expected). The paired possible probe reversed this trajectory: it began at the end point of the first possible probe, rolled at the same location on the block, and bounced off the block to end up at the initial position of the first probe. Each impossible probe was formed by swapping the trajectories of the impossible probes at the point they make contact with the block. The effect of this swap was that when the ball hits the block, instead of reflecting about the angle of incidence, it heads back towards its initial location, clearly violating the principles of directional inertia for colliding objects.
98 |
99 | ## Citation
100 |
101 | If you use the dataset, please cite:
102 |
103 | ```
104 | @inproceedings{
105 | piloto2020learn:,
106 | title={Intuitive physics learning in a deep-learning model inspired by developmental psychology},
107 | author={Luis Piloto and Ari Weinstein and Peter Battaglia and Matthew Botvinick}
108 | booktitle={TBD},
109 | year={2022},
110 | url={TBD}
111 | }
112 | ```
113 |
114 | ## References
115 | [1]
116 | Baillargeon, R., Spelke, E. S. & Wasserman, S. Object permanence in five-month-old infants. Cognition, 191–208 (1985).
117 | Baillargeon1985
118 |
119 | [2]
120 | Baillargeon, R. & Carey, S. Core cognition and beyond: The acquisition of physical and numerical knowledge. _Early childhood development and later outcome_ 33–65 (2012).
121 |
122 | [3]
123 | Spelke, E. Initial knowledge: six suggestions. _Cognition_, **50**, 431 – 445 (1994).
124 |
125 | [4]
126 | Aguiar, A. & Baillargeon, R. 2.5-month-old infants’ reasoning about when842objects should and should not be occluded. _Cognitive Psychology_ **39**, 116 – 157 (1999).
127 |
128 |
129 | [5]
130 | Hespos, S. J. & Baillargeon, R. Infants’ knowledge about occlusion and containment events: A surprising discrepancy. _Psychological Science_ **12**, 141–147 (2001).
131 |
132 | [6]
133 | Spelke, E. S., Katz, G., Purcell, S. E., Ehrlich, S. M. & Breinlinger, K. Early knowledge of object motion: Continuity and inertia. _Cognition_ **51**, 131–176 (1994).
134 |
135 | # Dataset Metadata
136 |
137 | The following table is necessary for this dataset to be indexed by search
138 | engines such as Google Dataset Search.
139 |
140 |
141 |
142 | | property |
143 | value |
144 |
145 |
146 | | name |
147 | Physical Concepts |
148 |
149 |
150 | | url |
151 | https://github.com/deepmind/physical_concepts |
152 |
153 |
154 | | sameAs |
155 | https://github.com/deepmind/physical_concepts |
156 |
157 |
158 | | description |
159 |
160 | Data accompanying
161 | [Intuitive physics learning in a deep-learning model inspired by developmental psychology]().
162 | |
163 |
164 |
165 | | provider |
166 |
167 |
168 |
169 |
170 | | property |
171 | value |
172 |
173 |
174 | | name |
175 | DeepMind |
176 |
177 |
178 | | sameAs |
179 | https://en.wikipedia.org/wiki/DeepMind |
180 |
181 |
182 |
183 | |
184 |
185 |
186 | | citation |
187 | TBD |
188 |
189 |
190 |
191 |
192 | ## License and Disclaimer
193 |
194 | Copyright 2020 DeepMind Technologies Limited.
195 |
196 | All software is licensed under the Apache License, Version 2.0 (Apache 2.0); you may not use this file except in compliance with the License. You may obtain a copy of the Apache 2.0 license at
197 |
198 | [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0)
199 |
200 | All other materials are licensed under the Creative Commons Attribution 4.0 International License (CC-BY). You may obtain a copy of the CC-BY license at
201 |
202 | [https://creativecommons.org/licenses/by/4.0/legalcode](https://creativecommons.org/licenses/by/4.0/legalcode)
203 |
204 | Unless required by applicable law or agreed to in writing, all software and materials distributed here under the Apache 2.0 or CC-BY licenses are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the licenses for the specific language governing permissions and limitations under those licenses.
205 |
206 | This is not an official Google product.
207 |
--------------------------------------------------------------------------------
/images/freeform_examples.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google-deepmind/physical_concepts/baa2776017ea3cc8c873ce682bb6646860e12cae/images/freeform_examples.png
--------------------------------------------------------------------------------
/images/splicing_illustration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google-deepmind/physical_concepts/baa2776017ea3cc8c873ce682bb6646860e12cae/images/splicing_illustration.png
--------------------------------------------------------------------------------