Machine learning classifiers and image processing projects

Today’s university lecture was about machine learning as applied to the field of image recognition. I was there as a tutor assisting the lecturing professor, who went over various details of how machine learning works, different algorithms, and how to measure their various statistical types of performance so you can compare them. In the tutorial part of the session the students got to run various classification algorithms and play with the software tools that we provide.

Several teams also asked me about the end of semester project and reports that they have to do. They’re thinking about what topic they want to investigate and they need to get our approval before beginning, just in case they attempt anything unethical or questionable. (For example, using copyrighted data or taking photos of people without consent.) One group was thinking about using medical scans to detect cancerous tumours, another using automotive camera photos to classify objects on or near roads that cars might need to avoid, another just using a large database of photos of different objects to classify them, and another hoping to read photos of car number plates. These are all kind of standard ideas that many teams often have and are all fine.

Other activities today: Mailing more Magic cards to an eBay buyer. Walking Scully a couple of times. Making spaghetti pesto for dinner.

Oh, and we had some rain while I was coming home from university. It’s the first rain we’ve had since 24 August, 19 days ago, when we just had a trace 0.2 mm. The last time we had serious rain was 17 August. We’ve really been enjoying the lack of rain though, after the last 2.5 years of ridiculous amounts of rainfall.

New content today:

Some photos, some image processing

I mentioned yesterday that the shops next to Maggio’s Italian Cafe in Cammeray were being demolished. I took some photos but didn’t have time to upload them yesterday, so I thought I’d show them today. Here’s a view of the rear of the properties:

Demolition of Cammeray shops

This is close to where I sit on a bench while I eat the lunch that I’ve bought from Maggio’s Bakery. There’s a nice shady bench where I can sit and eat while Scully hangs out nearby. So I saw the demolition work in progress while I was eating yesterday. And then when we left, I walked out to the street at the front of the buildings:

Demolition of Cammeray shops

Here you can see Maggio’s Cafe (not the Bakery, which is in a separate shop a couple of doors to the left). The yellow facade used to be a small grocery store, and the white one next to it is also being demolished – I forget what sort of shop used to be there. (Google Streetview just helped – up until mid-2022 at least it was a place that did casual art classes, where you learn to paint while sipping wine, and then in early 2024 it became a display suite for new apartments. Possibly apartments which are now about to be built on the site.) It looks like the old brick facade is being kept – you can see it is intact, but all of the building behind, seen through the windows, is gone.

I suspect the plan is to build shops at street level, with a few floors of new residential apartments above. There’s quite a bit of this sort of urban renewal going on around the local suburbs at the moment.

I also took a photo today, at the University of Technology Sydney.

Urban shapes

I liked the building shapes here. The left and right buildings are part of the university. The greenery-covered building with the suspended solar reflector is so-called Central Park tower across the road. I don’t quite know how the reflector is supposed to work, since the mirrors are angled downwards.

Okay… I found a website with some engineering information about it! There are also heliostat mirrors on the lower roof level of the adjacent tower, which reflect sunlight up onto the suspended mirrors. Interesting! In fact I think you can see one of the roof-mounted heliostats at the lower right corner of the sky in my photo.

I was at the uni of course for this week’s image processing lecture. The professor talked about machine learning in an image recognition context.

In the evening I made lemon pepper pasta for dinner, using another of the free lemons I got last week.

New content today:

My first second university coursework lecture!

Today I gave my first second lecture of regular coursework for a university course, as I’ve mentioned preparing for over the last few days. The professor had an important meeting and asked me to give the lecture for him. I’ve done “guest lectures” before for this image processing course, during the project work period, on topics that weren’t strictly covered by the course, but this is the first second lecture I’ve done that was actual course material. (Edited after the professor reminded me I in fact did one last year!)

In the morning I did a couple of critical thinking classes. Then I had to get ready for the trip to the university. I would normally leave at 12:30 and walk Scully down to my wife’s work to drop off there and then catch a train in. But I ran out of some ingredients for my usual home lunch fixings (falafels and tortilla wraps), so I decided to walk up to the shops and get some sushi. I didn’t really have time to walk back home again so we went straight from there to my wife’s work and arrived a little early.

After dropping Scully off, I rode on the new Metro train from there in to the university. This train line only opened on Monday, and it’s a significant change from the style of train lines Sydney has always had. Our old train network is heavily interlinked, with many lines diverging and converging, so the train traffic has to be carefully regulated to avoid collisions between trains on different lines merging into one. The Metro is designed on the principle of a single line with no branches or merges, so the trains can run more frequently and faster while still being safe. From my place to Central Station (the closest station to the university) takes 16 minutes on the old line, but only 12 on the new Metro line.

Being a brand new rail line, the stations are gorgeous and clean, with impressive architecture. Here are some photos: Victoria Cross Station.

Sydney Metro: Victoria Cross

Sydney Metro: Victoria Cross

Sydney Metro: Victoria Cross

I arrived in good time for my lecture. It was about image processing operations like binary morphology, cross-correlation, segmentation, and so on. It’s material I know pretty well and the lecture went smoothly. I made sure to try and give context and motivation for every algorithm that I covered, and explain it in simple terms. Afterwards, a couple of students came up and told me they enjoyed the lecture and thought I explained things well. So that was good!

And another Metro photo: Central Station, on the way back home:

Sydney Metro: Central

Tonight for dinner I made lemon pasta with broccolini, garlic, black pepper, and Parmigiano Reggiano. I used a fresh lemon that I picked up for free from a crate of lemons out the front of someone’s place. Presumably they have a lemon tree out the back and had ridiculous numbers of lemons so wanted to give them away. It was super juicy and the pasta turned out delicious.

I’d use fresh lemons more, but I always feel like paying $1 or whatever for a lemon from a supermarket is bad. It just fells like lemons are a thing that should be free.

New content today:

Ticking off many tasks

I had several things I wanted/needed to get done today. I started making a Darths & Droids comic, from a script we worked on last night (with my friends online), ready for tomorrow’s update. Then I made Irregular Webcomic! strips for tonight and tomorrow.

With those out of the way, I had some tasks to do for photography standards work. I went through the list of currently open ballots for international standards, recommending voting positions for the Australian committee, and emailing the committee members about those.

Then I had to do some mandatory training exercises for the university, so that they will pay me for the lecturing and tutoring work I’m doing. I had four new courses to complete, about data security, fraud, corruption, and remote working. One course said it took 10 minutes to complete, but it had about 5 or 6 videos to watch, each of them three minutes long! It took me 25 minutes to complete that one. The others had more reasonable time estimates. Overall I spent about an hour and a half on them.

I kind of wonder, has anyone in the world ever done a mandatory training course and then failed the quiz at the end so many times that they actually had to resign or be dismissed because they couldn’t complete the mandatory course?

After that I went through the lecture material for tomorrow’s image processing lecture, to make sure I knew all the work and could explain it to the students. I had to refresh myself on the Canny edge detection algorithm, for about the tenth time in my life. But having to lecture about it to students tomorrow will hopefully mean that I never forget the details of the algorithm again!

This evening I had three ethics classes in a row. We’re having fun discussing Sayings. a friend of mine suggested using some foreign sayings and found a good one in Swedish:

Att glida på en räkmacka.

Translated literally into English, this means:

To slide in on a shrimp sandwich.

I told the kids this and then asked them to guess what the saying meant metaphorically. I got some wildly varied answers, including:

  • To do something dangerous, like sliding on something slippery
  • To be lucky
  • To make something delicious
  • To be lazy, like sliding off your couch
  • To do something ridiculous

My own guess, before I knew the correct answer was “to make an unwelcome appearance”. But it turns out the real meaning in Swedish metaphor is “to succeed without having to work at it”. This is a really fun topic, at least with kids who get into the spirit of it. I had one class where they were all a bit reserved, and nobody wanted to guess in case they got it wrong.

Oh, my wife got to ride the new Metro train today, from the station near her work to the one near our home. A day before I get to try it to go to the university tomorrow!

And the weather today was absolutely gorgeous! We got up to 26°C. I don’t think this winter has any real cold left in it. It’ll be a touch cooler the next few days, but then next week we’re forecast to have a run of 25°C, 28°C, and 26°C. It was so nice going out today without a jumper or jacket on.

New content today:

A nice day for a lunch out

This morning I finished off my lesson plan for this week’s new critical thinking/ethics topic of “Sayings”. I found some interesting medieval and foreign sayings that modern English speakers aren’t familiar with, to give to the kids to let them try to puzzle them out.

For lunch I drove with Scully over to Two Chaps at Marrickville, where I met my old friend Lisa. We grabbed a table out on the footpath, under a large umbrella to keep the sun off, and had a nice meal. I had the “corned beet” Reuben sandwich, which I’ve had before and really enjoyed. We had a big catch up conversation. She’s started working a part time job—for the first time since raising her kids—doing aged care home visits. She used to be a nurse, so has relevant experience.

After lunch I drove back home, made a comic for tonight’s update, and did the first class with the Sayings topic. Only one student, who was returning after a long break, but it was a lot of fun.

For dinner I made mushroom risotto. I’m just now trying to write some new Darths & Droids material. I need to get a new comic made tomorrow, but I’ll also be busy revising the image processing lecture material to make sure I’m ready to deliver the lecture on Thursday.

The lecture is on image segmentation and image analysis, covering topics such as thresholding, edge detection, pixel morphology operations (erosion, dilation, skeletonisation, etc), geometric property measurement, and convolution and cross-correlation. Should be a fun lecture! (This is serious, not sarcastic, in case that wasn’t obvious. 😀)

New content today:

Image processing lecture 2

Today was busy, with two online ethics classes for kids in the morning, then a short break before heading into the city for this afternoon’s university lecture on image processing. It’s a really big class this year and as I was walking around to help students during the tutorial exercises I noticed some tables sized for 6 people had 8 or 9 people squashed in around them, and there was not much room between all the people to squeeze between the tables.

The lecture used the full three hour time slot and I got home with less than half an hour to spare before my next ethics class. I had a quick snack, some brie and crackers, before the class. After that I made some actual dinner – ramen noodles with broccoli and sesame sauce. And had a shower and then it was another ethics class!

And that was pretty much the day.

New content today:

Start of a new Image Processing semester

Today I went into the university to begin my work of tutoring for the new semester of the image processing course that my associate runs. This year the class runs from 2pm to 5pm on Thursdays, a welcome change from last year when it ran 6-9pm (on Tuesdays). And the class is huge, close to 300 students! We’re in a big lecture room and it was very full.

The first lecture is an introductory overview of image processing, and context for why it’s useful and what it’s used for, plus some administrative stuff about the course content and assessment, and a demonstration of Matlab, the software we use for teaching the practical components. It ended a bit early, but there were dozens of students waiting around afterwards to ask the professor questions. Some of them came over to ask me instead, since I’d introduced myself as a tutor early in the lecture. The most inevitable question is people asking if they can change their assigned project team group to be on a team with their friends. We always tell them no, the groups are assigned randomly to give them experience at working with strangers, which is important for future employment, and nobody can change teams. Some of them really don’t want to hear that answer!

I made it home with plenty of time for my evening ethics classes. I had to do a tough thing today and write a message to a parent telling them I can’t teach their kid any more. The kid is outside the listed age range of the class by 2 years, on the young side. Although the kid (I’m not going to use a gender-revealing pronoun) is very smart and able to converse on the topics, the kid is really not mature enough to engage in a group discussion without constantly interrupting and not letting anyone else get a word in, either me or the other students. I gave this kid two weeks and that was enough. I was almost tearing my hair out by the end of the second class, and decided I just couldn’t cope with it any more. The kid was also extremely pedantic and not willing to engage with the premises of the questions as intended.

For example, in this week’s topic on Shapeshifters I asked: “If everyone could turn into animals, would that be good or bad?”

The kid replied with, “People can’t turn into animals.”

When I pressed and said, “Yes, but imagine if we could. Would it be good or bad?”

And the kid responded, “People don’t need to turn into animals. We’re superior.” And this is just one example – there were several other questions where I couldn’t get a straight, non-pedantic answer that took the question in the intended spirit.

Maybe the kid is neurodivergent, but I didn’t honestly get that impression more than just a lack of maturity. I have other kids I know are neurodivergent and I can handle them fine, but this kid was just too much for me. I felt it was better for both of us that this kid not take my classes any more, at least for another year or two. I’ve never had a problem kid like this before.

Also today I mailed off another package of Magic: the Gathering cards. Nearly 1000 cards from the Fallen Empires set. Most of these cards are worth almost nothing on the secondary market, so I was glad someone wanted to buy a bulk lot of them and I can get them off my hands.

New content today:

Blowing young minds with quantum mechanics

This morning I had my next visit to Loreto Kirribilli for mentoring with my four students there. They’re learning about waves at the moment in their science class, and the teacher suggested I talk about something related to light.

I started by asking them if they had any questions and one girl asked about sonic booms. I explained that by drawing diagrams to show how an object moving faster than sound creates a shock wave. Along the way I also mentioned the Doppler effect, since it’s closely related.

Then having started with sound waves I moved on to talk about interference, explaining destructive and constructive interference. I talked about how interference is used in noise-cancelling headphones and how they work. Then I went into an explanation of the double slit interference pattern, framing it first in terms of sound waves, building on the example of the headphones to explain the pattern of loud and soft areas.

All right, now we were ready to talk about light—also a wave. And if we take a single-wavelength light source like a laser and shine it on double slits, we get the same interference pattern as bright and dark spots of light. And if you change the wavelength, you change the spread of the pattern. So far, so good.

Then I switched tracks and started talking about electrons, which we had discussed at length last time. I explained how you can create a beam of electrons, by ionising something and accelerating them in an electric field. One girl asked if this was related to cathode rays, so we took a bit of a diversion into that and why they were called cathode rays historically. And how old cathode-ray TVs and displays worked.

Then I asked a question: What if we fire this beam of electrons at a double slit?

I could virtually see the wheels turning in the girls’ heads as they pondered why I was asking this question, and what the answer could possibly be. I didn’t keep them in suspense too long. I said you’d see an interference pattern, exactly as if it was a beam of light. This is what’s actually observed if you do the experiment. I explained that electrons are not “particles” in the way we think of macroscopic particles like marbles or grains of sand. They don’t behave in the same way as macroscopic particles. They behave like waves. I tied this back to last time’s discussion of electron orbitals in atoms, and explained that this wave behaviour is what’s behind the strange shapes of the orbitals, as the electrons are essentially interfering with one another.

I also mentioned that if you change the speed of the electrons (by changing the voltage of the electric field in the beam generator), then you change the spread of the interference pattern—exactly as if you were changing the “wavelength” of the electrons.

At this point the teacher reappeared. I asked him how much longer we had, and he said about three minutes. I said, “Great. That’s enough time. I’m just about to blow their minds.”

Okay, I said, so we get this interference pattern when we fire a whole bunch of electrons at a double slit. What if we slow it down? What if we fire one electron at a time; say one per day? Today we fire one electron. Where will it land?

Again, it was obvious the gears were turning in their heads. I said, “Well, it might end up here, right in the middle.” And I drew a dot. “Tomorrow, we fire another electron. Where’s that going to land? Maybe not the same place. It might end up here.” And a I drew a dot off to one side. “And the next day?” I kept adding more dots, one at a time, faster and faster, talking through that each electron was being fired once per day, so they couldn’t possibly be interfering with each other, but that over time as the dots accumulate you see exactly the same interference pattern emerging.

A single electron passing through double slits will have a chance of landing in different positions depending on the interference of its wave nature. We have no way of predicting where any individual electron will land, but we know it will have this shape built up over many electrons. Which slit does a single electron “go through”? We don’t really know. It acts like it goes through both at once. Matter at small scales like electrons and atoms doesn’t behave at all like macroscopic objects. It exhibits this mixed wave/particle nature that seems odd to us.

I looked from the whiteboard I was drawing on to the girls and they were all staring at me wide-eyed, absolutely rapt.

And the bell went off, and it was the end of our time together for the day. It was really cool. This was our last lesson for this term. They have a mid-year break, and then in the new term after the break the teacher needs to organise plans for the rest of the year. So it’ll be a few weeks before I see them again. But definitely looking forward to it!

After the lesson I took Scully to Maggio’s bakery for a slice of pizza, and I picked up another one of their award winning apple pies, to take home for dessert tonight. Back home, I packed a bunch of cards for sending to eBay buyers:

Packages

Then I had to drag them all up to the post office for mailing. It was quite a task carrying all of them and handling Scully at the same time, even though I drove most of the way there.

Back at home I did another section of the Lego D&D set. First, photos of stage 16 which I did yesterday. Skeletons!

Lego D&D set, stage 16

Lego D&D set, stage 16

And the roof frame is completed, awaiting the next storey to be placed on top. And today’s stage 17 was just this cool displacer beast:

Lego D&D set, stage 17

Lego D&D set, stage 17

Which fits into the room like this:

Lego D&D set, stage 17

This evening I restarted my critical thinking/ethics classes, with the new topic on “The Countryside”. One notable response I got was to the question “How important is it for children from the city to experience the countryside?” I expected answers like it’s good to see farms where your food comes from, or to see wildlife. But one student said that it was a good idea because there’s no Internet connectivity there and kids can spend time off their devices!

Oh, and one kid was joining from a new country: Lebanon. He’s normally in Dubai, but is travelling, and took the time to still connect to my class. But someone joining from Lebanon brings my country list up to 53.

New content today:

Finished marking, oh my

I had a full day today, five ethics classes. And in between during the afternoon I finished marking all of my university Data Engineering student project reports and presentations.

It was a bit of a slog, because most of the reports were not particularly high quality, with some fundamental mistakes and misunderstandings of how to apply statistical tests and present graphical data. The last report I had to mark was a final breath of fresh air though, as they had actually done the statistics correctly and achieved a decent result for their experiment.

They wanted to determine if brand awareness had an influence on people’s judgement of photo quality. They got a series of photos of the same scenes taken by an Apple and a Samsung phone camera, and made surveys where they showed them side by side and asked people to pick which photo they preferred. In one survey they showed the photos labelled simply as “option 1” and “option 2”. In a second survey with different people they labelled the photos as “Apple” or “Samsung” respectively. And then in a third survey they switched the labels so that the Apple photos were labelled “Samsung” and vice versa. I thought this was a really clever bit of experiment design.

The results showed that out of 200 responses to survey 1 (20 people judging 10 photo pairs each), 96 favoured the Apple photos, and 104 favoured the Samsung. This established a baseline for comparison, which was pretty even. In the second survey, they found 111 favoured the “Apple” labelled photos (which actually were Apple), while 89 chose “Samsung”. And in survey 3, 112 favoured “Apple” labelled photos (which were actually Samsung), while 88 chose “Samsung” (actually Apple). This is a pretty cool result! It really suggests that some people are swayed towards photos that they think were taken with an Apple phone, even if they weren’t. They did a chi-squared test on the numbers, but the p-value was 0.12, meaning there was a 12% chance of this discrepancy happening by random chance. We usually expect a value of 5% or less before we say that it was likely not random, but 12% is pretty close. The problem for this analysis is they didn’t quite have enough data – if they’d received the same proportions with more data it would have been more significant. Anyway, it was a really nice experiment and project and write-up.

The other thing I did today was take Scully for a long walk to Botanica Cafe for lunch. I started working my way down their all-day breakfast menu, from the first item, a “breakfast bowl” of tapioca and chia seeds with preserved mangoes, coconut, and fresh figs and berries. It’s delicious and cinnamony, but a large sweet meal for lunch really filled me up for the afternoon and I was craving something savoury afterwards. I waited for the minestrone that my wife made for dinner, using yesterday’s leftover vegetable soup.

New content today:

Games class and marking

This morning I wrote my class for this week’s critical and ethical thinking topic on games. I have all new questions from the games topic I ran last year, asking the kids what actually is a game, and what aspects of games can make them fun for people to play. And what can be good or bad about games.

I also started marking the university Data Engineering course final reports and videos. I need to get this finished by Friday. Hopefully I’ll have it done tomorrow.

New content today: