Using AI to Generate Images for Public Works – Post 2

water color sketch of a water valve
AI-generated image of a water valve

In the first post on this topic I introduced the Midjourney AI tool which can be used to generate images. In this post, I’ll talk about a few more image generating tools I have tried. The first is Canva. This tool is fairly easy to use; however, you will need to make a free account to access it.

If you decide to try Canva and visit their site, you will find a lot going on there because Canva does a lot more than just generate images from text. To find the AI tool on their site, you can click “Apps” and when the next screen comes up look for “Text to Image.” Once you click that a box pops up asking if you want to use this in a new design or existing design. You can click “use in a new design.” If you do this, you’ll see they offer a drop down with a long list of items from which you can choose. When I am creating an image I usually want a 512 x 512 pixel image, so I choose “Custom Size.” If you make this same choice, you can indicate your image size and then click the button “Create New Design.”

screenshot of the Canva text to image app
Screen shot of the Canva Text to Image App

Next, you should see a screen like the one shown in the image above. There is an area on the right with the blank canvas and a small input area where you can type the description of what I want. Initially I tried “a person putting their garbage can at the edge of the road.” For the style I left it at “None.” After a short time, the image below is what it generated which wasn’t quite what I had hoped for. A person is only in one of the images, and the can is actually in the road.

Four images of a blue garbage can sitting in the road. One image has a woman in a red shirt and black pants crouching down near the can.
AIi-generated image of a garbage can along a road from Canva

So I tried again this time choosing the “Dreamlike” style. The images generated were a little closer to what I was looking for, but the person was a small child in two of them, and the one with an adult did not look realistic. Here is how it came out:

four images showing garbage cans in the road. A small child in standing near a can in two of them while a woman is near one in another
AI-generated image of a garbage can from Canva

After not really getting what I was looking for I tried a different image. This time I typed “a stream winding through a field of grass and trees.” I left the style at “none.” The image generated which I included below turned out close to what I had envisioned. Although if I wanted to use this to illustrate a stream in my area, I would need to try again and add text to indicate no mountains.

four images showing a stream winding through a field of grass with some trees. Three images have mountains in the background and the remaining one has a waterfall.
AI-generated image of a stream from Canva

Another image generating AI often talked about is DALL-E 2. This AI is brought to you by OpenAI – the same organization which offers ChatGPT. Just like with Canva, you will need an account to try out DALL-E 2. Once you log in, this is how the site looks:

Screen shot of the DALLE2 site
DALL-E 2 Website

In the prompt line I typed in the same text I tried with Canva: “a person putting their garbage can at the edge of the road.” DALL-E 2 generated four images, the same number produced by Midjourney and Canva. What I really like about the images generated by DALL-E 2 is they download with a DPI resolution of 300. The other tools download at a smaller size, and I always have to bring them into my image editing software to upsize them. Also, almost all of the images generated by DALL-E 2 were close to what I was looking for. I added below the one that I thought was best.

image of a brown garbage can at the side of the road with someone's arm resting on top of it. There is a car in the background.
AI-generated image of a garbage can by DALL-E 2

And just for fun, here’s another image I generated on DALL-E 2 a while ago using the following text: “a red fire hydrant van gogh style,”

an image of a red fire hydrant
AI-generated image of a fire hydrant by DALL-E 2

Of the two tools discussed here, I had better results with DALL-E 2. Plus there is the added bonus of not having to process the images in an image-editing software to get them to the resolution I need. Both were free to use, although Canva has some terms of use you may want to check out if you are using the images you create on their site for work.

Share

Using AI to Generate Images for Public Works

globe with an image of a tree growing in the ground and birds flying and mountains in the back all in a primarily green color.

As noted in the last blog post, Can AI Help Fix a Water Main Break?, Artificial Intelligence or AI may eventually be a really useful tool for those of us working in the public works field. In this post, I’m exploring its use as a tool to generate images. This is helpful because many of us are often tasked with either developing reports, newsletters, notices, or presentations. And with copyright laws, it can sometimes be a struggle to find a non-copyrighted image we want to illustrate our writing. Some of us may be talented in creating our own graphics, but that can take a lot of time even if we have those skills.

AI can help solve many of these challenges. It can generate an image very quickly. And if the first one doesn’t quite work, we can quickly generate another one. Or we can generate a few and ask colleagues for their opinion on which is best to use.

Regarding copyright, I have seen a lot of comments online suggesting this is a problem. But a recent publication in the Federal Register by the Library of Congress U.S. Copyright Office seems to indicate at least in the United States images generated by an AI from text cannot be copyrighted. Here’s some of the findings noted in that publication:

  • In the Office’s view, it is well established that copyright can protect only material that is the product of human creativity.
  • …when an AI technology receives solely a prompt from a human and produces complex written, visual, or musical works in response, the ‘‘traditional elements of authorship’’ are determined and executed by the technology—not the human user.
  • these prompts function more like instructions to a commissioned artist—they identify what the prompter wishes to have depicted, but the machine determines how those instructions are implemented in its output.

The publication goes on to indicate if a human takes the AI-generated image and either modifies it or uses it in a creative composition that is determined to now be developed by a human, then that final work may be considered to be copyrighted. There are instructions in the publication of how to submit for registration of copyright of an AI-generated work that a human has modified.

However, I am not an attorney and would suggest running this entire question of copyright by your own legal department for verification.

If you get the green light from legal to use AI to generate images to help you at work, your next question may be where is this magical AI tool and how do I use it? Over the past few months, I have tried some AI tools that I’ll share with you starting with my favorite one below:

Midjourney: so far this has become my favorite image-generating AI. Although at first it was a little uncomfortable for me to get used to. I still find their website a little scary when it initially comes up because they have a lot of changing text that makes me immediately think I accidently clicked a site that will hack me. Also, their website is not where their AI tool is found. Instead you join their Discord group and generate images there.

So if you are not used to Discord that may also be initially uncomfortable until you get used to the interface. Fortunately I have been using Discord for a while now so that part was not so bad for me. You can access and join Discord through the Discord website, and you can download and install the Discord app on your computer from their website. From the Discord site you can search for the Midjourney Discord server. Here is the direct link: Midjourney Discord Link which should bring up the site shown in the image below. From there you can join the Midjourney Discord Server by clicking the button which says “Join Server.”

Screenshot of the Midjourney community site on Discord

Once you get to the Midjourney Discord Server, as I said it can be overwhelming if you are not used to the interface. The quickest way to try it out is to click in the column on the left on a newbies listing in one of the Newcomer Rooms. The image below shows the result of me clicking on newbies-102. It shows a running result of the images generated by Midjourney based on text people have input.

Screenshot of the Midjourney Discord Server showing images generated by the AI tool

You can see the text inputs vary from a very simple description to more complex. Midjourney wll generate four different images for each request. You can further refine a specific image by clicking the boxes underneath. The U boxes are for upscale an image while the V boxes ask the tool to vary it. I created the image at the start of this blog post in Midjourney with the following text prompt: /imagine a scene showing nature in an earth day theme using green as a predominant color. There are a lot of sites online which offer guidance on how to use the tool, and Midjourney has a Quick Start Guide where you can get more detailed information than I have included here.

I will follow up with the other AI image-generating tools I have tried in the next blog posts.

Share

Can AI Help Fix a Water Main Break?

Robot in orange suit standing on a wet road looking down with cars parked on the side of the road

Maybe you’ve heard about AI, and maybe you haven’t, but odds are you most likely will. There are many types of AI tools being developed. One example is ChatGPT, a text-based tool providing answers to questions in a conversational manner. Since ChatGPT launched late last year, it seems everyone is discussing Artificial Intelligence (AI) and what it means to society. Being in public works, I can’t help but wonder about all the impacts to our industry

So today I thought about using the ChatGPT tool to see if it could help me figure out how to fix a water main break. After all, this is a common issue that comes up in public works, and I was curious to see how AI would respond. Could AI take the place of that wise, seasoned employee? Based on its advice I wouldn’t be ready to send it out to the jobsite just yet. Here’s how the conversation went:

My input: How do i fix a water main break?

ChatGPT’s answer: Fixing a water main break typically requires the expertise of a professional plumber or water utility company. It can be a complex and potentially dangerous task that requires specialized equipment and training.

Here are some general steps that may be involved in fixing a water main break:

  1. Shut off the water supply: The first step is to turn off the water supply to the affected area. This may involve turning off a valve or shutting off the main water supply to the entire property.
  2. Locate the break: The next step is to locate the break in the water main. This can be done by observing signs of water damage or by using specialized equipment, such as listening devices or cameras, to pinpoint the location.
  3. Excavate the area: Once the break has been located, the affected area will need to be excavated to expose the damaged section of pipe. This may involve digging a trench or using other methods, depending on the location and accessibility of the break.
  4. Repair or replace the pipe: Depending on the extent of the damage, the pipe may need to be repaired or replaced. This can involve cutting out the damaged section and replacing it with a new piece of pipe or using specialized equipment to seal the break.
  5. Test the repair: After the repair has been made, the water supply should be turned back on and the system tested to ensure that there are no leaks or other issues.

It is important to note that these are general steps and that the specifics of the repair process may vary depending on the location and nature of the water main break. In any case, it is recommended that you consult with a professional plumber or water utility company to ensure that the repair is done safely and effectively.

My assessment: The AI gave a fairly simple explanation. To be fair, I didn’t give it a lot of detail regarding my expectations for its answer – I just asked a question. And I’ve found that being more detailed in your expectations for the output can make a big difference in the response. However, even with the simple steps provided by ChatGPT, I thought it left out a few critical items. So I followed up:

My input 2: In general that is good, but I think you should add a step where you call for utility locates before digging. That is really important. You should also add to the testing section a note about the need to test for water quality before allowing people to drink the water after the repair.

ChatGPT’s answer 2: You are absolutely right. Before excavating the area, it is important to call the local utility locating service to identify any underground utility lines that may be present in the vicinity of the repair site. This helps prevent accidental damage to other utility lines during the excavation process, which could result in further disruptions to utility services, property damage, or even personal injury.

Additionally, after the repair has been made and the water supply turned back on, it is important to test the water quality before allowing people to drink or use the water. Water quality testing can help ensure that the water is safe and free from contaminants that could be introduced during the repair process. This testing may involve taking samples of the water and sending them to a laboratory for analysis, or using on-site water testing equipment to check for things like chlorine levels, pH balance, and other parameters.

Thank you for bringing these important points to my attention.

My assessment: The AI was very accepting of my suggestions and polite in its response readily incorporating the information. I also liked that in its first response it emphasized the need to consult a professional. I’m going to keep testing out the tools, and as I do, I’ll try to share some of it in future posts. I’m also interested to see what others are doing with AI to help support public works and government work so reach out if you want to share!

Share

April is National Safe Digging Month

Yes construction can and does take place all year long. But in the Midwest where frost can get down to about three to five feet, activity tends to drop off as winter sets in. We typically use this time indoors to plan for next year’s projects, and as the robins show up and warmer breezes blow in, we start setting up project schedules for the year. But as we kick things into gear, we want to remember the importance of calling for utility locates before we sink any shovels into the jobsite. To help promote this important step in the construction process, the Common Ground Alliance launched its annual support of National Safe Digging Month.

You can check out their website for resources and graphics that you may be able to use for your operations. And if you are a community, you may be able to use some of the graphics to promote calling before digging with your residents. It’s surprising how easy it can be to hit utilities sometimes doing things you wouldn’t even think would cause a problem. I was on a jobsite once where the contractor was securing the site at the end of the day. One of the workers was pounding in metal fence posts to hold up the orange construction fencing around the site. He pounded one right through a communication cable. Some of the crew ended up having to stay until the utility could repair the cable. The worst part of it was after he broke it, he noticed the line had been marked – he had pounded the pole right into the orange line. He most likely didn’t think pounding a metal fence post could break it like digging could. It was a good lesson to me that before you do anything in an area of a locate where you are putting something in the ground, you need to locate that utility first or move away from it if possible.

National Safe Digging Month logo showing someone planting a tree with a shovel.
Share

National Building Code Adoption Tracking Portal (BCAT Portal)

BCAT Portal image showing US colored according to level of code adoption

In a blog post the other day I shared information about the No Code No Confidence website where people can put in their zip code and find out the status of building codes in their area. Today I am going to introduce a similar site called the National Building Code Adoption Tracking (BCAT) Portal. According to FEMA which hosts the site, the BCAT Portal is an interactive WebGIS map that tracks five hazards (flood, seismic, tornado, hurricane wind, damaging wind) and displays:

  • Code adoption information for Census Incorporated Places
  • Additional metadata such as the latest decennial U.S. Census population and National Flood Insurance Program Community Identification (CID) number
  • Mutual aid layer displaying mutual aid laws
  • Regulations information from the annual Mutual Aid for Building Departments fact sheets
  • High risk areas and code adoption and weakening information for each individual hazard, or view a comprehensive combined hazards layer

People can use the map by clicking an area and then reading information about the community at that location. The information is displayed in a separate window on the left side of the screen as shown in the image at the top of this post. I’ve also embedded the portal at the end of the post so you can access it just by clicking on it.

In the example in the image, I have clicked on Custer county, Montana. You can see in the image the information that came up shows the county has adopted both the 2018 International Building Code (IBC) and the 2018 International Residential Code (IRC). The county’s CID number in the National Flood Insurance Program (NFIP) is also displayed along with the county’s status in the NFIP which is participating. The population of the county based on the census is shown too. If you click the “State Building Code Link,” it will take you to the state website which offers information specifically about building codes in the state. In Montana, the agency which oversees building codes is the Business Standards Division. Each state regulates building codes, permits, licensing, and training differently so it’s important to check out the specific requirements in the state in which you live or work.

The BCAT Portal applies a color to each area based on the level of code adoption in that community. The legend below shows what each color means.

BCAT Legend

When zoomed out, the colors are applied at a county level. If you zoom in the colors are instead applied to the communities within the counties. I’ve included an image that is zoomed in around the Dallas area so you can see an example of how the colors change to show community adoption status when zoomed in.

BCAT zoomed in on Dallas area in Texas

If you are focused more on protection from specific hazards you can click on the tabs at the top of the map which highlight different hazards. The two mutual aid tabs show information regarding Emergency and Incident Management compacts.

Share

What Homeowners Need to Know about Building Codes

In June 2021 FEMA released a Building Codes Toolkit for Building Owners and Occupants. While I encourage everyone to check out the publication, I thought I would summarize some of the main points here in addition to adding a few of my own suggestions.

Why do we have modern building codes?

There are four primary reasons:

  • To minimize accidents and damages and related insurance claims
  • To eliminate squalor and impacts to health
  • To support local government in ensuring health and safety to taxpayers
  • To reduce damages and loss of life in the event of a disaster.

So why is this important to a homeowner? It’s important because having strong building codes which are supported by a good local inspection program helps make sure homes are built to protect people as much as possible. When I took training for becoming an electric inspector, they told us some provisions are added to the electric code because they have been proved to reduce deaths. Other provisions are in the code to protect against fires. I think most people want to be protected in their home as much as possible from fire and death.

But strangely enough when I was a building inspector I had a few experiences where people building a new home told me they shouldn’t have to follow the code because it was their home and they should be able to do what they want. The problem with this approach is that no one owns their home forever, and the home usually remains in the community long after the person who built it has moved on. So their decision to introduce a risk into the home impacts future occupants and the community. If something happens in that home such as a fire, there could be loss of life. And local firefighters who end up entering that home may face risks they are not expecting.

What codes should my community adopt?

While some states and local communities pass their own codes, many pass what is referred to as the I-Codes. These are standard codes developed by the International Code Council or ICC. This organization hosts hearings each year to consider suggested updates to the codes then publish a new version of the codes based on the outcomes of those hearings. A community may not need to adopt a new version each year, but it is important to stay up to date enough so that new building technologies and research that can lead to increased protection are incorporated into the code. Studies have shown many people believe their community is already taking care of this, but unfortunately many are not.

So how can you encourage your community to adopt up to date building codes? First you can check the No Code No Confidence website to see if your community has the latest version of the building code. If the codes are the most recent version, you could send a simple email like this to your elected officials:

“I was on the No Code No Confidence website and noticed our community has adopted the most recent building codes. I want to thank you for keeping our community safe by adopting these codes and ensuring they are up to date.”

If they are not the most recent, and especially if they are significantly out of date, you could send the following language in an email to your elected officials:

“I was on the No Code No Confidence website and noticed our community has not adopted the most recent building codes. I want to urge you to consider adopting the most recent codes. Not doing so puts property owners and building occupants at risk. Only by adopting up to date codes can we ensure our community stays resilient to disasters and other risks. Thank you for considering my request.”

What can I do to ensure my own home remains safe?

Sometimes we decide to make improvements to our own homes. In doing so, it is important to find out if the work you plan requires a building permit. You can find this out usually by visiting the building department website for your community or visiting or calling your local community and asking if a permit is needed for the work you plan. Getting a permit helps ensure the work that will be done on your home meets current codes and helps keep you safe.

Other resources in the toolkit

The FEMA Building Codes Toolkit also has a checklist with questions to ask your builder if you are having work done on your home or building a new home. There is also insurance information and links to many more resources.

Share