15. Wildcard Week

This week, I decided to delve into machine learning. This topic can seem quite daunting and definitely intimidating, especially if you don’t have coding experience. However, I believe there’s a significant difference between learning to create your own ML models from scratch and training a preexisting model to perform a specific task. So, I used Teachable machine to train a model to recognize and distinguish between male and female fish.

Teachable Machine is a user-friendly tool by Google that allows anyone to train a machine learning model without any coding. It’s particularly useful for quick, proof-of-concept projects and educational purposes. This tool made it easy for me to train my model to distinguish between male and female fish.

Training a model:

This process was surprisingly simple. It was just a matter of uploading pictures of each fish and training the model to distinguish between them. I was amazed to find that you can use very few images, especially since this was an easier case due to the distinct differences between males and females. The males have different body shapes and vibrant orange colors, whereas the females are pale beige. All I needed to do was create two categories and add the images of each, as you can see in the following image:

Then you simply need to click “train.” This training process is conducted locally in your browser. Therefore, it’s recommended not to switch to a different tab or open the tab in a separate window during this time. Surprisingly, the training is quite fast, indicating that it doesn’t require much computational power.

Here, you can see how the model distinguishes between different male Endler guppies. Additionally, you can observe the percentage of certainty with which the model differentiates between them. The results were quite conclusive, with certainty percentages nearing 100%.

Possible problems you might encounter:

This process is relatively simple, but there are some potential issues you might encounter. Fortunately, these can be mitigated by taking certain precautions when capturing the photographs you’ll use. The first point to consider is ensuring consistency by using the same camera, lighting, and settings as the final images for the model. For example, when photographing these fish, I took the pictures up close using the x0.5 lens on my phone. For the highest quality, I would have used the x2 zoom from a greater distance, but most people shoot images up close with the x0.5 lens due to its closer minimum focus distance. Interestingly, even if some users select the x2 lens, the iPhone will often default to the x0.5 lens and digitally zoom in. Therefore, I decided to digitally zoom in on some of the pictures to train the model accordingly.

Another important consideration is lighting. I used consistent lighting because lower light levels tend to increase noise, which could negatively impact the results. It’s also crucial to shoot the fish against various backgrounds. For instance, if you photograph most male fish with plants in the background and most female fish with sand in the background, the model might learn to distinguish between plants and sand rather than males and females. Lastly, avoid having both males and females in the same frame, as this could significantly confuse the model.

By adhering to these guidelines, you can ensure that your photographs are suitable for model training and help achieve more accurate results.

Practical Aplications

A more advanced version of this model could be highly beneficial in various real-world applications. For instance, it could detect mosquito larvae and fish to assess the effectiveness of projects aimed at reducing mosquito populations. By monitoring how quickly fish consume mosquito larvae, it can provide valuable data on the efficiency of biological pest control methods. This application is particularly useful in ecological research and environmental management, helping to mitigate the spread of mosquito-borne diseases.

in aquariums, the model could assist in maintaining the health and balance of the ecosystem by accurately identifying and monitoring fish populations. This would enable better management practices and ensure the well-being of the aquatic life. Additionally, it could be used in educational settings to teach students about fish species and their characteristics, making learning more interactive and engaging.

Future Projcets

As I continue to learn and develop my skills in machine learning, I plan to enhance this model in several ways. One of my goals is to develop an AI that not only distinguishes fish but also identifies specific behaviors. This could include monitoring feeding patterns, mating behaviors, and overall activity levels. By recognizing these behaviors, the model could provide insights into the health and well-being of the fish.

Furthermore, I aim to extend the model’s capabilities to count the total number of fish in an environment, calculate their average lifespan, and assist in selective breeding projects. These enhancements would be invaluable for scientific studies, offering precise and reliable data to support research efforts. Integrating this advanced model into larger systems could revolutionize aquarium management, ecological research, and conservation projects.

By focusing on these future developments, I hope to create a comprehensive tool that not only identifies fish but also contributes significantly to understanding and managing aquatic ecosystems.

Files