Many children will remember the disheartening experience of bringing home a goldfish from school in a plastic bag and asking their bewildered parents why it kept swimming around its tank. Turns out we may have underestimated fish intelligence all along: recent research suggests they display complex behaviors such as shoaling and caring for young. Some studies even demonstrate they can recognize faces!
Fish have brains capable of processing emotions and pain, which have even outshone some larger mammalian cousins in laboratory tests. Each species adapted its brain structure for specific lifestyle needs while still sharing core architectures which evolved over 400 million years of vertebrate evolution with ecological/behavioural demands shaping brain designs into multiple variations that exist between species.
The dorsal pallium in fish brains is an anatomically non-laminated brain region arranged into five broad nuclear regions: dorsomedial, dorsolateral, dorsodorsal, and dorsoposterior (Northcutt 2011). Although similar in many ways to mammalian neocortex structures, evidence from electrophysiological recordings and neuroanatomical tracing suggests it does not divide into functional zones like those seen on mammals; rather input from somatosensory system input is processed across multiple interconnected areas which have topographic maps as topographic mapped topographically-mapped topographic receptive fields overlap receptively (Northcutt 2011).
However, this does not indicate that fish feel pain. Pain is an emotional and sensory experience which depends on activating specific neurological sensors called Nociceptors in our brain. These receptors alert us when exposed to potentially painful stimuli such as needle punctures or bee stings while prompting our bodies to respond by reflexively pulling away from any harmful stimuli such as needles.