You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.
Let be a morphism in some category. We think of as a source we wish to image, as an observation process, as a collection of possible observations and as the observations actually obtained.
If factors through some , so for , we think of the observations obtained by as determining the observations made by . For example, if we are working in , we have for any . So, the observation is determined by the observation . This can be used to describe the situation where one sensor (or collection of sensors) collects observations that determine the observations another sensor must collect. However, this situation is unusual.
Probably more common is the situation where two sensors collect different data, and where the observation collected by one can not be used to compute the observation collected by the other. However, the observations are still consistent with one another. That is, it is possible for both observations to happen at the same time. I am wondering if we can view the statement of consistency as the existence of a span . Intuitively, this is saying there exists a complicated enough object , so that there exist observations and of that object, so that the two sets of observations obtained and can be obtained simultaneously.
Does this make sense? Can spans be used to reason about "consistency of observations"? How is "consistency" modelled in applied category theory in other contexts?
I feel there is a gap between the application you describe and the mathematics you are using. If A is a source and B is the set of possible observations, then I would say the map f : A → B _itself_ is the observation. Concretely, you might think of A as the set of coordinates of sample points, B is the set of intensities, and f is the function that returns the intensity at each sample point. Consequently, taking the image of f is a disastrously lossy process.
I appreciate you sharing your thoughts, @Zhen Lin Low !
I am thinking about your example. I not sure the best way to model imaging, and alternate strategies for doing this are of interest to me.
One thing that is nice about your approach - where a function is viewed as the observation itself - is that it naturally incorporates an indexing of the observed data. By looking at you can say, "we observed at location (or time) ". The ordered pairs of correspond to observations, where we keep track of when/where data (e.g. intensity data) was collected.
This indexing of observation data is absolutely vital, as you note. Just marking down intensity values in your example, while ignoring the coordinates of sample points, would indeed be "disastrously lossy"!
However, I believe it is also possible to include indexing in the image. To rephrase your example in this form, let be a set with a single thing we want to image - say it is a painting. This is a set with a single element. Then, let send this single element to indexed observation data. The image of is a set, with elements consisting of ordered pairs - the first coordinate correspond to location in the painting, and the second coordinate corresponding to the intensity observed there. In this case, the image of retains the indexing data we need.
Does you feel this addresses the gap you were describing? I would appreciate any further thoughts you may have.
It would be more reasonable to say f is an "observation process" in that model, yes. But it remains unclear to me what the point of taking the image is, and the role of the map h is also unclear. As previously discussed, when A is just a point, any two maps f, g : A → B will be related by some h : B → B.
Zhen Lin Low said:
But it remains unclear to me what the point of taking the image is, and the role of the map h is also unclear. As previously discussed, when A is just a point, any two maps f, g : A → B will be related by some h : B → B.
Thanks again for your thoughts, @Zhen Lin Low. That is a really good point regarding what happens if A is a set with a single object. So the example I gave above doesn't appear to be describing an imaging system in the way I want.
Perhaps the problem is that I am modelling the "thing-to-be-imaged" as a set with a single element. Let me instead try to model it as a function . Each element of corresponds to a position, and is the intensity of the painting at location . Considering this as an object, we want to figure out what an observation morphism should be.
I noticed that the painting now corresponds to a functor from the category to . Call the source category , following the notation for objects of the simplex category. So, our model for the painting corresponds to a functor . We can think of the first object of [1] as corresponding to "where", and the second object of [1] as corresponding to "what".
Let us also model observations as functors from . Then, let maps between the painting and its observations correspond to natural transformations of these functors. This seems to be an improvement over the previous approach - I think we no longer have the problem that any two observations of the painting are related in the way you describe above!
I was typing up some engineering research work on imaging, and I noticed some similarities and differences between the structure of the objects involved and what I described above.
In my engineering research, we have a (noiseless) model for observations: . Here is the observation observed (a finite dimensional vector), is a function describing an unknown source, and describes the observation process.
In more detail, is a function that return the absorbing strength of a source at each point in the plane. We can also view as a function, , as it keeps track of when (and where) the data was observed. Then is a function between function spaces .
This is similar in some ways to what was described above, but also different. We can view both our observation and the unknown source as functors from to . This matches what I was saying above.
However, the observation process is a function between function spaces - not a natural transformation. This doesn't match what I was saying above.
So, maybe this is a reasonable category for describing some imaging processes:
-The objects are sets of functions (thought of as unknown sources, or observations)
-The morphisms are functions between these sets, thought of as imaging processes
Unfortunately, we are going to have the problem described earlier again. Any two functions from a set with a single element (a function) will be "equally informative". Hmmm.
You seem to be fixated on the "equally informative" concept. May I gently suggest that, in light of growing evidence, that the definition is ... wrong?
Well, it is certainly possible. There is some intuition I'm trying to model. It's possible that I'm modelling it wrong.
For the record, here is the intuition I'm trying to model.
Imagine we drop a pebble in a pond. At some point in the pond, we have a sensor that can detect the height of the water there. It records the height of the water over time, recording a ripple pattern.
Imagine we have a priori information that the only disturbance of the water is due to a single pebble.
Now, imagine we have a second sensor that also observes the height of water.
Given the readings on sensor , the locations of sensor and , and the a priori information that the disturbance to the water is due to a single pebble - given all these things, we can compute the readings that occur on sensor .
I would like to be able to model this situation, where one observation can be computed from the other given appropriate context.
I don't care so much about modelling things as being "equally informative", as I care about one observation being "at least as informative" as another.
As a simpler example, the readings on sensor and sensor together are enough to calculate the readings on sensor . So, the two readings together are at least as informative as the reading on sensor in isolation.
I would very much welcome any ideas you have on how this situation could be modelled in a better way (instead of terms of morphisms factoring through one another).
(I'm continuing to think about this too!)
I think part of what's going on here is that the image of every function from a singleton set specifies up to isomorphism. So in this sense all such functions are "equally informative" about . But a set with a painting of sunflowers is different in the context of imaging paintings than a set with a painting of a mountain.
Maybe a way forward is to work in a category with fewer morphisms, so that fewer things are isomorphic. Then any approach that can distinguish objects (up to isomorphism) will be able to distinguish more things.
This might involve modelling a thing-to-be imaged as something more structured than a set.
I'm still thinking about this. I'll try to come to some clearer conclusions before sharing my thoughts.
I would agree with Zhen Lin that, coming from a background in category theory rather than image analysis, I'd naturally want to think of a category as something being observed and a functor as some process of observation. Then, I would say is at least as informative as iff factors though up to natural isomorphisms, i.e. there is some functor such that , where means there's a natural isomorphism from to .
Here you can think of as some "data processing". (You can also think of it as an observation if you like: this very general framework doesn't distinguish between "observing" and "data processing", which makes sense since observations often include some data processing.)
So, the idea is that is at least as informative as if you can get , at least up to isomorphism, by doing and then doing some data processing.
Thanks again for your thoughts! I think they will be helpful going forward. The modification of factoring through up to natural isomorphism is interesting. I will have to mull that over - maybe try to think of a concrete example to illustrate that.
In the meantime, I've shifted my modelling approach a little. I am thinking there is a problem with having a category where objects are things we observe, and morphisms are observations of those. In particular, every category requires there to be an identity morphisms associated with each object. I am worried that this would require there to be a "perfect observation" of each object - something we generally don't have access to in applications.
As a result, I want to make things simpler and first consider a category of the environmental interactions of some fixed object, which we can think of as grounding the concept of "observation". So, in this setting, the thing being imaged does not appear as an object - instead the interactions of that thing with its environment correspond to the objects. As motivation for focusing on environmental interactions, in x-ray projection imaging, we don't directly observe the unknown object - we observe a sort of shadow in x-ray beams fired at the object. Also, in some cases, observing a particular special environmental interaction of an object is just as good as observing the object itself.
I hope to associate each environmental interaction with a specific range of space (and time) locations. If space and time can be split up in to little pieces (say, open sets), then this will allow us to talk about observations at a particular place (e.g. we observe the temperature in this open set at this time). I am hoping that the observations will naturally inherit structure (some kind of lattice?) from the structure of space and time.
We can also hope that this perspective of environmental interactions will lead to a way for thinking about imaging.
To illustrate, imagine we have a sequence of interactions (each "x->y" can be read as "x changes y"):
sun -> temperature field around sun -> temperature reading on probe
If we can go from "temperature reading on probe" to "temperature field around sun", we can view this as providing an explanation for the temperature reading on the probe. "The probe reads XXX because it is in an area with a temperature of XXX". Following the slogan: "Imaging is explanation of environmental changes", we can view this explanation as providing a sort of image of the temperature field.
So, if we can start talking about relationships between environmental interactions - and in particular deducing (or ruling out) some from others - this is not so different, necessarily, from talking about imaging.
I'm trying to connect these ideas to the discussion in Seven Sketches. To this end, I made a little diagram that tries to imitate the sort of diagrams we see in that book:
environemental interactions
"Imaging" corresponds to trying to go backwards along this chain of events - to figure out something about the sun from the sensor reading.
I hope that, at each point along such an "interactions chain", we can get a category of environmental interactions (with morphisms corresponding to inclusion of subsets, relating interactions over smaller and larger areas). It would be interesting to consider if there are functors between different categories along such a chain.
Anyways, I guess I feel that the stuff in Seven Sketches is starting to seem more relevant (I'm starting to want to think of imaging in terms of systems that link together and influence one another). Probably next on my list is to work through more of that!
David Egolf said:
Thanks again for your thoughts! I think they will be helpful going forward. The modification of factoring through up to natural isomorphism is interesting. I will have to mull that over - maybe try to think of a concrete example to illustrate that.
For example, one observation might give you an output written in decimal numbers while another might give it written in binary; then we might use a natural isomorphism to translate between them. This example is vague because I haven't specified the precise categories and functors involved! Indeed I'm pretty fuzzy about the details of the categories you're talking about. I don't remember you describing examples of these - in complete details, where you specify the objects, morphisms, and how to compose morphisms. That makes me very nervous, but I can respond in an equally vague way.
Thanks @John Baez for your thoughts, as always.
Let me try to make a category that describes at least a little of what I want, and describe it precisely.
To start, some motivation. We want a category that is a category of "environmental interactions of an object with respect to a single property at a single moment in time". At a given moment in time, the environmental interactions of an object correspond to modifications it makes to its surroundings, in space. As a concrete example, say the object is a person, and the interaction with their surroundings at this moment in time corresponds to them standing in a field of fresh snow - so the snow is depressed under their feet. The interactions with the snow occur over space - each little part of each show of the person reduces the height of the top of the snow. We want a category where the objects are the different parts of these interactions. It seems reasonable to split up the modelling of the interactions over space, since each modification of the environment occurs at some location in space.
Now, to describe a category. We start with a topological space , defined by a set and a topology . This will play the role of the field on which the snow rests in the example above. Next, we need to specify the places in space where an interaction/modification has occurred. To do this, we specify a subspace of , having the subspace topology. In our example above, this corresponds to where the shoes are resting. We can talk about different parts of the shoes using the open sets . Next, we want to talk about the modification made to the snow height for each piece of the shoes. To do this, we use a function for each open set . Let be the set of possible values for the height of the snow. Then the function specifies the height of the snow in the region . These functions are "environmental interactions" and so they should be objects in our category .
To summarize so far, we have a topological space and a subspace of , having the subspace topology. We have a set , and for each open set of , we have a function . So, we have one function per open set of . Let these functions be the objects of .
To specify a category, we need to specify morphisms. Let there be exactly one morphism from to iff . This allows for at least some rough comparison of environmental-interactions.
There are a lot of limitations with this, but it's a start!
I think this needs a lot of work. Your concept of morphism doesn't involve the functions at all, just the sets , so I believe it is equivalent (in the technical sense) to the category of open subsets of the topological space .
This category is a poset.
The posets of open subsets of an arbitrary topological space is a wonderful and much-studied thing, but I'd be hard-pressed to convince anyone it has anything to with snow, people's feet, or image processing.
You said a bunch of things about a field of snow, footprints, shoes, etc. - but none of this made its way into the mathematical description of the category at the end. As far as the end result goes, you could have just said "consider the poset of open subsets of a topological space ".
You are right - it needs lot of work! I wanted to make a start, though.
I actually thought the described category was isomorphic to the category of open subsets of with morphisms corresponding to inclusions. (But is it just an equivalence? I suppose it doesn't matter - we don't want either).
Something more clever needs to be done with the morphisms - we need a rule for specifying morphisms that cares about the functions and not just the corresponding set . If the morphisms don't notice the modifications to the environment (the ) the category really doesn't reflect anything about them!
Here's an idea. Let us have a morphism exactly when these two conditions are satisfied:
In addition, it seems unsatisfying to only consider a single function from each subset , as this only lets us talk about one environmental interaction at a time for a given location. It would be nice to able to talk about different interactions so that we can compare them in some way.
So, let the objects of the category now be the functions from the open sets of to . For any given open set , there are a bunch of associated objects, each one corresponding to a single function from to .
Now the category is looking different than the poset of the open sets of , I think (I hope!).
I think this is describing the snow-field example a little better. If we pick a given object, and then consider a sequence of morphisms from it, this corresponds to considering successively larger areas of deformed snow, each of which contain the previous area of deformed snow inside of it (having the same deformation).
In a similar spirit, a cospan should correspond to two smaller areas of deformed snow contained inside a larger area of deformed snow.
I actually thought the described category was isomorphic to the category of open subsets of with morphisms corresponding to inclusions. (But is it just an equivalence? I suppose it doesn't matter - we don't want either).
It's equivalent, not isomorphic, because for each open subset the described category has many different isomorphic objects, one for each function on that subset.
I'm also confused about whether you're talking about open subsets of or open subsets of , since you said both things here:
We have a set , and for each open set of , we have a function . So, we have one function per open set of . Let these functions be the objects of .
(If your category only involves the subspace you don't need to mention in the first place, since any subspace of a topological space is a topological space in its own right, so you can just start with .)
But this doesn't affect my main point. My main point is that if you want to apply category theory to image processing the way you're doing, I believe you should cook up some examples of categories that are convincingly connected to image processing.
John Baez said:
I actually thought the described category was isomorphic to the category of open subsets of with morphisms corresponding to inclusions. (But is it just an equivalence? I suppose it doesn't matter - we don't want either).
It's equivalent, not isomorphic, because for each open subset the described category has many different isomorphic objects, one for each function on that subset.
Hmmm. I don't actually think this is the case (?). In the original formulation, I associate exactly one function with each open set. So there is a bijection between open sets and the objects .
John Baez said:
I'm also confused about whether you're talking about open subsets of or open subsets of , since you said both things here:
We have a set , and for each open set of , we have a function . So, we have one function per open set of . Let these functions be the objects of .
Oops! I mean open sets of .
The reason I'm mentioning at all (as a space containing ) is that I am hoping in the future it will provide a sort of ambient space where multiple will live. But it's true we don't use it right now.
David Egolf said:
John Baez said:
I actually thought the described category was isomorphic to the category of open subsets of with morphisms corresponding to inclusions. (But is it just an equivalence? I suppose it doesn't matter - we don't want either).
It's equivalent, not isomorphic, because for each open subset the described category has many different isomorphic objects, one for each function on that subset.
Hmmm. I don't actually think this is the case (?). In the original formulation, I associate exactly one function with each open set. So there is a bijection between open sets and the objects .
Okay, I thought the were all possible (continuous?) functions . If there's just one then you're right: your category is isomorphic to the poset of open subsets of .
To a category theorist this means the functions are utterly irrelevant to the definition of your category.
They might become important in some later construction, but not in defining that category.
John Baez said:
But this doesn't affect my main point. My main point is that if you want to apply category theory to image processing the way you're doing, I believe you should cook up some examples of categories that are convincingly connected to image processing.
Hmmm. In my mind the "snow-field" example is convincingly connected to the process of imaging. Let me see if I can convince you there is a connection.
One could break the process of imaging into a few steps:
there is an object -> it interacts with something -> we process those interactions to make an image
For example, for ultrasound imaging:
there is a heart -> we bounce ultrasound waves off it -> we process the ultrasound wave echoes to make an image
So, in my mind, creating a language for talking about interactions of an object with its surroundings is very much on topic to imaging - it describes the first part of the imaging process.
John Baez said:
To a category theorist this means the functions are utterly irrelevant to the definition of your category.
Do note, however, that (I think) they are very important in the updated definition I provided afterwards, where we define morphisms in terms of the .
David Egolf said:
Here's an idea. Let us have a morphism exactly when these two conditions are satisfied:
- on the intersection
The idea is to have a morphism from to when " consistently fits inside ".
Namely in this formulation of morphisms ^
David Egolf said:
John Baez said:
But this doesn't affect my main point. My main point is that if you want to apply category theory to image processing the way you're doing, I believe you should cook up some examples of categories that are convincingly connected to image processing.
Hmmm. In my mind the "snow-field" example is convincingly connected to the process of imaging. Let me see if I can convince you there is a connection.
One could break the process of imaging into a few steps:
there is an object -> it interacts with something -> we process those interactions to make an image
For example, for ultrasound imaging:
there is a heart -> we bounce ultrasound waves off it -> we process the ultrasound wave echoes to make an imageSo, in my mind, creating a language for talking about interactions of an object with its surroundings is very much on topic to imaging - it describes the first part of the imaging process.
That's a bunch of words, but when it comes around to defining your category, you could skip all those and just say "let be a topological space; my category is the poset of open subsets of ".
And this is different from successful applications of category theory that I know, where the categories involved are often deeply connected to the mathematical details of the subject they're being applied to. For example there's a category of chemical reaction networks, where the objects are chemical reaction networks (some sort of mathematical gizmo that chemists study).
I don't think the current category is a poset.
(with the updated definition of morphisms)
David Egolf said:
David Egolf said:
Here's an idea. Let us have a morphism exactly when these two conditions are satisfied:
- on the intersection
The idea is to have a morphism from to when " consistently fits inside ".Namely in this formulation of morphisms ^
This is getting more interesting; it still has nothing to do with image processing per se, but this is an example of what category theorists call "the category of elements of a presheaf category".
Let me try to connect this more closely to image reconstruction.
Image reconstruction in the context of ultrasound imaging is the process of taking sound waves, and figuring out how they could have been produced. I believe this can be viewed as asking the question: what states of environmental interaction (through sound waves) are consistent with the sound waves we see now?
So if we can talk about interactions being consistent with one another, in my view we are long ways towards making images.
If I understand correctly your new category is still a poset since if there's a morphism from to and also one from to they are equal.
I'm afraid all your talk with words goes right past me; I look at the math. If I were feeling more energetic I would actively work to translate your words into interesting math, but I'm not.
In practice, we don't require total consistency - but rather approximate consistency.
The traditional reconstruction algorithm for ultrasound imaging basically asks: "What scattering amplitude should this point have, so that the data that we would expect to come from it looks as much as possible as what we actually see?"
John Baez said:
If I understand correctly your new category is still a poset since if there's a morphism from to and also one from to they are equal.
I should have clarified - it is not (I think) the poset of the open sets of anymore. It might still be a poset.
John Baez said:
I'm afraid all your talk with words goes right past me; I look at the math. If I were feeling more energetic I would actively work to translate your words into interesting math, but I'm not.
Hmmm. Let me explain a reconstruction algorithm similar to "backprojection", a standard image reconstruction approach - using math instead of words.
We have a system model :
here is what we observe, is an unknown object of interest, and is a matrix
Then to estimate , we compute
For me, this intuitively corresponds to asking "How similar is what we observed, to what we would expect to observe if there was a unit strength source at location ?"
As another example of this idea in image reconstruction, expressed in math, I am currently doing research on reconstructing photoacoustic images. The model looks like this:
We estimate the unknown object by minimizing a loss function. Notice that this loss function includes a discrepancy term (the 2-norm term), comparing the observed data and the expected data for some guess .
The point I'm trying to make:
Both of these examples involve talking about consistency (generally only partial) between what we observed, and what we would expect to observe under some guess for an unknown thing
(As another example of why I care about relating different environmental perturbations: often we have multiple sensors observing different parts of a sound wave. They then have to work together to make an image. Figuring out how to do this is important).
So, a language for talking about (ideally partial) consistency between different perturbations of the environment is interesting to me for purposes of image reconstruction.
The category you called "the category of elements of a presheaf category" I think starts to go in this direction, as morphisms correspond to a statement of consistency relating environmental perturbations over smaller areas to those over larger areas. I would also want to be able to talk about consistency across time (e.g. to describe a propagating wave), as well as space. But I was trying to make it as simple as I could to get started.
I don't know if this helps. I would like to describe this stuff in better math for you, but that's what I'm aiming to do - I haven't done it yet
I hope something I posted above is helpful. I'm happy to clarify anything if you would like. And as always, thanks for your time and interesting comments.
Sometime when I'm feeling more peppy I'll see if I can dream up some math connected to what you just said.
Btw, often it's not category that's needed, but some other sort of math. The bigger ones toolbox, the more likely one will find the appropriate tools.
For easy reference going forward, here is the most recent version of a category trying to describe environmental perturbations at a fixed moment in time, with morphisms enabling us to talk about consistency between perturbations:
As indicated by John Baez above, I believe this category has the structure of a partial order.
Using this category, let us say that and are "consistent" exactly when:
(this is a span!)
Let us also say that is "a consequence of" exactly when:
We can then consider the set "of all consequences" for any object .
This corresponds to the set of all environmental perturbations known to have happened if the environmental perturbation has happened.
The idea I'm inching towards here: an image is a special kind of consequence of some special environmental perturbation (namely the perturbations of our sensors) - e.g. if we observed this pressure-wave on our sensors, then there must have been this initial pressure distribution in the unknown object corresponding to an image.
To go further towards this idea, I think we will need to talk about consistency across time, which will involve including some notion of a time-update operation in our category.
Starting here John Baez explains how the category above is a special case of a "category of elements".
He also notes that putting a topology on , enabling us to consider continuous function to , could be useful.
Let me update (and re-describe) the category above using these helpful things.
We start with a topological space .
-- I conceptualize this as the "environment" of some object.
Let be the partial order category of its open sets, with a morphism exactly when .
-- I conceptualize this as a way of keeping track of how the "nice subsets" of the environment relate to each other.
For each open set of , let be the set of all continuous functions from to a topological space .
-- I conceptualize this as the set of all possible "nice" perturbations of some environmental property at location .
Let be the functor that acts by on objects. On morphisms it acts as follows: if , so there is a morphism in , then the image of this morphism under is the function which acts by , where and is with its inputs restricted to .
--I conceptualize this as describing how the possible nice perturbations of the environment relate to one another - which ones are physically consistent in the absence of additional contextual knowledge
We can now form the category described above using a somewhat different language:
--Every object is an element of for some open set of , so an object is a function
--Every morphism is an element of a morphism for some open sets of , so a morphism is a function that restricts to , yielding a result
This is slightly different than what we described above:
Intuitively, it seems is inducing a preorder on functions (a "consistency relationship") by its action on morphisms in . The resulting preorder is described by the restriction of functions, and is inherited from the restriction of one open set to another.
I'm currently thinking about a next step to take in this modelling:
Can we figure out a way to "chain together" environmental perturbations?
An example of why we care about this for imaging. We have this chain of perturbations:
heart -> ultrasound wave echoes -> changes in voltage on receive sensing array
I want to next model the situation where we get to observe only part of a perturbation.
Now, I think we can start talking about imaging processes.
Maybe:
This definition doesn't require the imaging process to make good estimates for , which can be viewed as an ideal imaging process. Maybe that's something to think about going forward.
It seems like a lot of what I'm saying would be retained if we just talked about functors between partial orders. Since each partial order is a preorder, all the stuff on preorders in Seven Sketches should apply.
For example, I think the notion of "upper set" is going to be helpful.
Related to that, I wonder if a "reasonable" observation and imaging process is going to correspond to a Galois connection.
If observation is a functor and imaging is a functor going back, then it makes sense to me that we'd like them to be a Galois connection. But this only applies when "imaging" goes back to the original category. Is that really called "imaging"? It's more like reconstructing your best guess of the original scene - the one you're observing.
I'm having trouble deciding if you're right about this.
Probably that means I need to pick some particular example of something that is certainly "imaging", and see if it fits in this framework.
Some initial musings about something I think of as "imaging":
-We bounce ultrasound waves (with the resulting echoes living in ?) off a heart (living in ?)
-We then take the resulting echoes, as sensed by a sensor (still living in ?) and estimate what they bounced off of (lives in ?)
The functor from A to B here (if it exists) would be different than the "windowing" functor I described above, though.
Maybe I should try and work out other examples of "observation" functors besides restricting what part of the perturbation we get to look at (which I call "windowing").
On a tangentially related note - it feels like somewhere in here one should have to talk about the wave equation (for this example) or more generally a rule that propagates environmental disturbances.
I agree that you should take some of your examples and try to fit them fully - with all relevant details - into some mathematical framework. For this, though, you should start with pathetically simple examples, so you can work them out in detail. (So, not involving the wave equation if you can help it: geometric optics is simpler.)
I have trouble with examples that turn out to be something like "the category of elements of the category of some presheaf on a topological space", since this is so unstructured that I have trouble seeing how you'd get much mileage out of it in imaging.
Making a really simple example with geometric optics sounds like a great idea!
I don't know a lot about optics, but hopefully I can muddle my way through.
I'm thinking I want to start with making an image of a point source of light using a lens and a screen.
I see there is such as thing as the category of lenses, but this appears to actually be a concept from computer science.
Yeah, many people here, like @Jules Hedges, @Matteo Capucci (he/him) and @Bruno Gavranovic, love those lenses - they're an application of category theory to computer science.
They have nothing to do with optics.... but wait! "Optics" has also been taken over by category-theoretic computer scientists - it's another technical term that has nothing to do with optics as you knew it.
Do you know where the name originated?
It makes some intuitive sense... in its original application, a lens is a way to view and interact with a database, so it's like there's a big book but you're looking at a portion of it through a magnifying glass.
But I don't know who invented the term and what they said at the time. Maybe the people I tagged know the history better.
The start of chapter 5 in Optics by Hecht has an interesting description of an "image" of a point.
The picture under discussion is:
optical system
Hecht describes the correspondence between the cone of rays emanating from to the cone of rays converging at as an image of .
He then generalizes this idea:
image as energy flow
Here an "image" of point is described as a point where enough rays (with enough energy) from converge.
That's nice! Yes, we don't tend to think often enough about how every object we meet is beaming waves of light in every direction. (The ancient Greeks thought the eye itself sent out beams:
Another established Greek theory of vision described the visual fire. This theory suggested that there was a light emitted by the eye that came into contact with the object being viewed. When the fire hit the object, it reflected back to the eye and the image was seen
That's a neat historical note!
An interesting thing about this notion of "image" is that it suggests that things can be more or less an image of something else. One could talk about "the extent to which is an image of " by talking about the fraction of radiant energy from that travels to , for example.
There is a more general notion of image going on here, actually:
virtual image
We say that there is a (virtual) image in this case, even though there are no physical rays converging to a point.
Geometric optics is a lot of fun. I haven't studied it enough, but I know Guillemin and Sternberg use it at the start of their book Symplectic Techniques in Physics to motivate the category of symplectic vector spaces and symplectomorphisms.
They use the linear approximation for lenses to treat them as morphisms in this category.
Let's keep it simple and say an image of is a point where multiple diverging rays from converge.
Let me start thinking about how this relates to the framework from earlier.
Let us say there is a point object , sitting in a 2D plane. It perturbs its environment by creating a collection of spherically emanating rays. We might try to model these rays as a function , so we specify a direction of propagation at each point in space. will be of a particular form to get a spherical collection of emanating rays.
Then, we introduce an optical system. This will modify the paths that rays take through space, yielding some new function , which will have a more complicated form. We say that contains an image of if there is a point in the plane where rays converge as described by .
A couple initial thoughts:
I suppose another perspective on this example is this - the optical system can be viewed as performing processing on the environmental perturbation (rays) produced by - presumably with the intent to figure out something about . So, perhaps we can think of the modified rays produced by the optical system as in some way an approximation of .
Digressing massively, this short article which just came out has a nice introduction to "lenses" in applied category theory - which as noted above, have nothing (?) to do with what we're talking about:
Thanks for linking that! I always enjoy learning just a little about something I know nothing about.
I think there might be some connection, actually, between lenses and iterative (image) reconstruction schemes(?).
From the article linked above, a rough first description of a lens is the following two things together:
Let be a set of unknown objects. Let be a set of possible observations of them. Let send each object to its corresponding observation.
An "iterative reconstruction strategy" is...
However, to have a lens, there are some additional compatibility laws that need to hold. I haven't checked those yet.
This compatibility law doesn't appear to hold:
compatibility law
If we have an , then is the updated guess for an unknown object given observation and current guess . However, there is no guarantee that the observation that would be observed from the object corresponding to this updated guess will actually match the observation obtained . (Although a good optimization scheme will be trying to reduce the gap between the two).
This law should hold, though (for a reasonable iterative reconstruction scheme):
law 2
If we have some object , and we compute its observation , obtaining the pair , then updating the "guess" given the observation should leave unchanged. There is no way to improve to better match the observed data in this case.
I don't think the third compatibility law would hold.
So, we don't get a lens in this way. Oh well!
Still digressing on lenses, this is a nice explanatory picture:
lenses
(image from: https://golem.ph.utexas.edu/category/2020/01/profunctor_optics_the_categori.html)
The idea is (apparently) that lenses can describe the process of:
I believe the little here is called the "focus", continuing the optics terminiology
According to the nlab, there is a also a notion of "lenses without laws" or "bimorphic lenses".
I wonder if the iterative image reconstruction approach outlined above would have this weaker structure.
Anyways, returning to a different kind of lens... In an effort to strive towards a "pathetically simple" example of describing an imaging system mathematically, let us consider this sort of situation:
lens
(image source here: http://hyperphysics.phy-astr.gsu.edu/hbase/geoopt/lenseq.html)
Together with the thin lens equation:
Where is the "object distance", is the "image distance" and is the focal length of the lens.
Apparently the upside-down arrow produced here is called an "image". However, I feel that this is only appropriate together with an understanding of the optical system that produced it. I could have a black-box optical system that generates an upside-down arrow, and it would not necessarily mean anything helpful about an unknown object.
So, in my opinion, the "image" is more properly:
This suggests that, more generally, we may want to think of an image as:
Probably it would be helpful to work out this arrow-lens example in more mathematical detail.
I think there are three key pieces here needed as input to an image-making algorithm:
These three pieces are also what I need as input to an imaging algorithm I have implemented in MATLAB for photoacoustic imaging. In this case, the pieces are:
Trying to describe this in a general way, using math, maybe we can say the three key inputs needed for a system that makes images are:
I guess a next challenge here would be to ask: Is there something in common about functions that correspond to "forward models" in the physical world, as opposed to arbitrary functions?
If you happen to have time, and interest, I would very much appreciate your thoughts on this direction @John Baez. I always find your comments helpful for directing my efforts in more productive directions.
Oh - on a related note!
I think I've thought of a category related to of our "elements of a presheaf" category we considered above, that should be capable of describing more context-specific structure, and doing more than just talking about spatial restriction of environmental perturbations.
For some indexing set , let each for be a set, called a "property type".
Let each for each be a set, called "property values".
A function is used to specify some property values of type .
Define a category where:
Let's see how this could be used in the lens example.
Say there are two properties of the unknown object: its position , and the position of its image as formed through the lens .
The possible values for both of these properties are the element of , in the absence of prior knowledge.
So, each value for the object position property is a function and each value for the image position property is a function .
To form a category, we need to pick some subsets of for object locations and also for image locations. For now let us have and , indicating these properties could have any values as far as we know. If we want to incorporate prior information, we could have specified smaller subsets of these collections of functions.
Now we need to define morphisms. We will do this using the lens equation . Let be the function that send to the function , where is the single element of the set . We can similarly defined a . These are the non-identity morphisms.
This is a very simple case, where the property are simple, we have no prior knowledge, and our "forward model" perfectly specifies one property in terms of another. It would be interesting to see if this structure can handle more complex cases!
Consider the example from above, of deformed snow in a field. Let be a topology, and the be the open sets of . There is only one property value set , corresponding to the height of the snow.
A continuous function describes the height of the snow in set .
This suggests we need to allow the to be more than just sets. We want to be able to view them (and ) as topological spaces here. This suggests a way to generalize the category we are constructing.
Category version 2:
For some indexing set , let each for each be an object of a category , called a "property type"
Let each for each be an object of , called "property values".
A morphism in is used to specify some property values of type .
Define a category where:
Now we should be able to describe the "perturbed snow" example in this framework.
Let the category .
Let be a topological space, and the be its open sets, viewed as subspaces.
Let for each , where is a topological space.
A continuous function specifies the height of the snow in area .
Define a category where:
This framework seems capable of describing a lot of the structure relevant to imaging, including incorporation of prior knowledge and "forward models"!
In general, the more prior knowledge we have, the fewer the objects and morphisms that will exist in the resulting category. The idea is that objects describe "possible property values" and morphism describe "possible relationships between property values" - so if we know more, then there are fewer possibilities.