Artificial Intelligence applied to aquaculture: How gender classification of salmon at early ages can increase productivity

Currently, Chile is the second largest producer of salmon in the world, after Norway. The two main species cultivated in this country are Atlantic (Salar) and Pacific (Coho) salmon, requiring a production cycle of approximately 3 years when, due to the anadromous nature of the salmon, two stages are identified: freshwater and saltwater.

The first year of production takes place in controlled freshwater environments (hatcheries), where the alevin are born and develop into young salmon (parr), weighing approximately 100-250 gr. and measuring between 12-15 cm. After smoltification (a process of adaptation to salt water) they are taken to raft cages at sea, where they begin to be fed special fattening diets. After two years, when the smolt salmon have reached a weight of between 4-6 kg, they are either harvested or, in the case of the brood fish, returned to the hatcheries for spawning.

The phase when production is most vulnerable is undoubtedly the period during which the salmon remain at sea, as they are exposed to conditions that are out of control, such as weather or water quality. In this sense, the problem began when the salmon industry experienced a major crisis in 2007-2008 following the appearance of the ISA (Infectious Salmon Anemia) virus, which led to a significant drop in production to around 60%. Today, the ISA virus still exists, in fact, outbreaks have emerged (June 2015).  In response, farmers have been forced to increase their use of antibiotics.

Being able to reduce the use of antibiotics would not only mean considerable economic savings but the salmon obtained would be of much higher quality, thus increasing the selling price and profits for the fish farm.

Our solution to the problem: gender classification of salmon at early ages

This increase in antibiotic use could be reduced if, during the fattening stage carried out at sea, farming were carried out differently depending on the gender of the salmon, as it is the males that are more prone to the development of diseases, the main reason for this increase in antibiotic consumption.

In this regard, it should be noted that the mixing of male and female salmon during their breeding produces the early maturation of the former (which usually leads to a stagnation in weight gain), so separating male and female specimens would cause an increase in the size of both genders (at least 9.9% and 11.8%, females and males respectively) by avoiding early sexual maturity and a decrease in diseases in both sexes due to transmission from mating.

In addition, from the point of view of raising alevin, it would also be advantageous to have a higher proportion of females in the facility’s broodstock because, by being able to fertilise the eggs (salmon roe) of more than one female with the sperm produced by a male, a greater number of fertilised roe will be achieved.

However, the analysis and gender classification of salmon at juvenile stages is a challenge for the industry today. The methods currently used in Chile are based on the use of ultrasound equipment with which an expert manually identify the gender of salmons from 400-1,000 grams in weight, not being able to identify them at earlier ages.

Ultrasonography (ultrasound) is a diagnostic method by images based on the use of sound waves and the subsequent capture of the echo that is produced when it bounces off the different organs and tissues, which is why it could constitute an optimal starting tool for our objectives since this technology is used in the study of organs and soft parts, organ measurements, fetal movements, etc.

Nonetheless, while it can be used to diagnose gonadal maturity and gestation stages in females, it does not allow for accurate gender classification of juvenile salmon (parr), as it is difficult to identify their gonads with the naked eye when the degree of maturity of the salmon is so low. In addition, these aquaculture services are very labour-intensive as they are currently only carried out manually.

In view of the shortcomings and limitations of current means of determining and classifying the gender of salmon, the opportunity was identified to develop and validate a rapid, automatic, cheap and reliable method for correctly identifying the gender of salmon at earlier ages, with the aim of achieving differentiated production between males and females when they are taken to sea, with all the benefits that this would imply.

Our methodology for developing the solution

Once our methodology was implemented, after analysing the technological challenge and the client’s objectives, we carried out a research that allowed us to define the best approach to solve the problem, specifying performances and carrying out a cost-benefit analysis.

In this sense, after an analysis of the state of the art, we determined that the use of ultrasound scans as a starting point was appropriate, but in order to achieve an automatic and intelligent salmon gonadal diagnosis and differentiation system of high precision and low cost, which would make possible the sexual identification of the salmon at very early ages (12-15 cm long, weighing between 100-200 gr), just before being taken to the salt water cages, it was necessary to advance through research and development activities.

Thus, it was necessary to develop elements of counting, gender classification and automatic separation that carry out the automatic analysis of each of the fish through the mathematical treatment of ultrasonic images, without the need for these to be interpreted by any expert.

In order to do this, it was first necessary to develop a specific image segmentation algorithm because, although the images taken with the commercial ultrasound machine allow the raw images to be obtained, i.e. the graphic representation of the ultrasound scans in grey scale, these generated images present interferences (noise) and certain anomalies that could hinder the subsequent work of the classifier. For this reason, in order to achieve this first challenge, it was necessary to put into practice a series of pre-processing techniques in order to improve the quality of the image as much as possible and to highlight only those objects that were desired to be identified over other bodies that appeared in the image, but did not correspond to objects of interest (the latter were known as artefacts). In other words, an attempt was made to apply an initial filtering process known as binarization process, the result of which was a black and white image instead of a grayscale image.

In addition, a further step in image processing was required and the study was focused on those areas of potential interest (abdominal area of the fish) so that the smallest possible image cutout could be made around the area containing the objects to be detected (in this case the gonads). In other words, we tried to apply a second filtering known as segmentation with the aim of reducing false positives during the subsequent processing of the classifier and minimizing the computational cost of data processing.

  Diagram of the binarization process, first step within the pre-processed module

Once this first objective was achieved, the second challenge was to design and develop the fish gonad analysis module based on a binarized and segmented image of the areas potentially susceptible of hosting the salmon stomach and gonads.

Thus, with the completion of the work linked to the first challenge, a binarized and segmented image of the areas potentially susceptible of presenting the salmon’s stomach and gonads was available. This reduced the size of the image to be processed and eliminated numerous artifacts that would make it difficult to classify the salmon by gender, but this image was still too large to analyse the existence of reproductive organs. For this same reason, a process based on Histograms of Oriented Gradients was required to be applied in the vicinity of the stomach walls until the salmon’s reproductive organs were located.

Histograms of Oriented Gradients (HOG) are based on the idea that objects (such as salmon gonads) can be characterized by their appearance. To do this, Histograms of Oriented Gradients obtain the orientation of the gradient of each pixel, thus generating the spatial distribution of the object.


In general terms, the main idea that was pursued was to implement a system that divided the image into small regions (known as cells) and obtained a histogram for each of them from the orientation of the gradients of the pixels that form it. In addition, for a better response, the contrast had to be normalized in larger areas (called blocks) and this result had to be used to normalize the cells of the block.

  Stages of the HOG descriptor.

In this way, the combination of the histograms generated for each of the cells will provide the representation of the image in the characteristics space. A Bayesian classifier analyses the regions of the ultrasonic image to characterise the pixels and determine the gonads.

A key premise was made for the final salmon gender determination: If reproductive organs are located within the gonads, given the early age of the specimen, these will be female reproductive organs (as male ones take longer to develop).

Like so, if the Bayesian classifier detects that gonads exist in at least 4 of the subdivisions it will be considered a positive result. This is done to avoid false positives in any occasional subdivision because of a structure similar to them.

Based on this premise, below are two ultrasound images of a female salmon and a male salmon, correctly classified by the algorithm and where the presence of gonads is visually appreciated in the case of the female (in green), not discerned in the case of the male (in red):

Ultrasound scan of female salmon (left) and male salmon (right)


Once analysed and classified, a mechanical valve separator takes each of the juvenile salmon (parr) to one or other of the rafts depending on their gender.


Automatic system separator based on the gender of the salmon


Finally, and as the last step of our methodology, this prototype was validated and tested through a series of tests carried out in order to verify the correct functioning of the system.

The measurement campaign took place in two freshwater aquaculture farms in order to increase the representativeness of the results. Specifically, Coho Salmon and Salar Salmon ultrasound scans were taken at the facilities of the company Salmones Austral S.P.A. in Lake Rupanco. These facilities are located, respectively, in the BioBio Region and the Los Lagos Region.


Fish bank from which samples were taken for validation of the new system


Through mathematical image processing we are able to automatically determine the existence of gonads in salmon at very early ages (12-15 cm long, weighing between 100-200 gr), something that is not possible through the manual classification methods based on ultrasound scans currently used.

In this case, Artificial Intelligence makes possible a process that allows to increase productivity and safety in the aquaculture industry while guaranteeing a higher price, and quality product for the consumer.

To find out more about this innovative solution, please download our specific brochure.

In addition, if you are looking to improve the productivity of your fish farm, do not hesitate to contact us to jointly develop a tailor-made technological solution that responds to your specific requirements.


AQUA – Aquaculture and fishing. Salmonid crops in Chile increased by 8.7% in 2017′. (2018)

Ban, M., Hirasawa, K., & Ezure, M. (2008). The Effects of Growth on Sexual Maturation in Sockeye Salmon. Aquaculture Science56(4), 605-606.

Davidson, J., May, T., Good, C., Waldrop, T., Kenney, B., Terjesen, B. F., & Summerfelt, S. (2016). Production of market-size North American strain Atlantic salmon Salmo salar in a land-based recirculation aquaculture system using freshwater. Aquacultural engineering74, 1-16.

EURE (Santiago) vol.38 no.115 Santiago set. 2012

Harmon, P. R., Glebe, B. D., & Peterson, R. H. (2003). The Effect of Photoperiod on Growth and Maturation of Atlantic Salmon (Salmo Salar) in the Bay of Fundy: Project of the Aquaculture Collaborative Research and Development Program. Fisheries and Oceans Canada.

Share on twitter
Share on linkedin
Share on whatsapp
Share on telegram
Share on email
Scroll to Top
Utilizamos cookies propias y de terceros para mejorar la experiencia del usuario a través de su navegación. Si continúas navegando aceptas su uso.    Más información