The Israeli laying hens industry is regulated by quota; a farm can produce eggs according to a fixed number of hens. With the new community cages now integrated into the Israeli egg industry, a manual head count of the hens is an impossible task. The aim of this study is to develop a machine vision system that automatically counts the hens, and helps the regulator to control the industry. The hen house that was used is 87 m long stacked on six floors, with 37 community cages set in a row, each cage is 2.4 m long, 0.54 m tall, and 0.74 m depth, housing 18-34 hens. The hen house has a narrow path along the cages. Consequently, a wide-angle camera was applied (HD Action Camera 1080p, wide angle 170 deg' lens) in order to frame the entire cage in a single field of view. The camera was mounted on a steel arm 0.85 m from the cages. The arm was connected to the feeder that moves along the cages. Videos with 30 fps were processed with an AI detection algorithm called Faster R-CNN. A feeding event appeared to be an adequate time to count the hens, as all hens were lined up in front of the cage, visible to the camera, making it possible to count. The detection algorithm was trained to detect hens in cages; it was tested on 4,000 images and got an accuracy of 80%. The algorithm count was compared to human observer count used as ground truth. The accuracy can be improved by further training the algorithm parameters.