"Imperfection" is an episode of Star Trek: Voyager, the second episode of the seventh season.
The episode begins with Janeway noting that they have come across a starship manned by Wysanti, Rebi and Azan's species. The children prepare to return home, and their people allow Mezoti to live with them as well, as attempts to contact her homeworld were unsuccessful. After the children say goodbye to Seven of Nine, she and Icheb discuss their feelings about bidding goodbye to them; noting that her ocular implant is malfunctioning, Seven briefly cries.
In Sickbay, Seven and the Doctor debate whether her crying was a malfunction, or an emotional response. After analysing her implant, the Doctor agrees it was the result of a malfunction - and also discovers that she has been suffering from headaches.
In Astrometrics, Icheb has completed an analysis of a nebula, and informs Seven that he wishes more challenging assignments - on the bridge, for which he would need to take the Starfleet Academy entrance exam. After agreeing to ask Captain Janeway for a letter of reference, Seven hides a malfunction of her hand, and excuses herself to the cargo bay, where she attempts to regenerate. The computer refuses to engage the sequence, noting that Seven's cortical node is malfunctioning. Seven goes to the mess hall, where she collapses in convulsions, with additional implants appearing on her face.
Back in Sickbay, the Doctor and Janeway discuss the problem with Seven - due to the malfunction in her cortical node, her body is rejecting her other implants that control her vital functions. In an effort to procure a replacement node, Janeway decides to take the Delta Flyer to a Borg debris field, and Tom Paris and Tuvok insist on accompanying her. Icheb attempts to do the same, but Janeway refuses. He then attempts to visit Seven in Sickbay, who orders him to leave.
In the debris field, Janeway and Tuvok transport to the location of several intact drones. After removing the cortical implant of one of them, they are surprised by a raiding party, who claim ownership of everything there. After a dogfight, the raiders break off, allowing the Flyer to return to Voyager with the new node. However, twelve implant simulations all results in failure. It has been inactive in a dead drone for too long and will not work in Seven. Informed of this, Seven begins to face the possibility that she may die.
Refused permission to leave Sickbay, she disengages the Doctor, and leaves anyway. She goes to B'Elanna in Engineering, and asks her about what happens after death. She notes that although as long as the Borg Collective exists, her existence as a drone will too, but if she dies as an individual, all she has accomplished since her link was severed will be lost. B'Elanna reassures her that she has made an impact on everyone on board Voyager, and that that would be her legacy.
Refusing to give up on her, Icheb comes up with a plan; to remove his cortical node, and replace it in Seven, as he is younger, and was never fully assimilated, leaving him less dependent on his node and more able to adapt. With a claimed 86.9% chance of success, the Doctor agrees to review his work. However Seven later rejects it, claiming the risk to Icheb is too high. Determined to prove he can survive without his node, he programmes his alcove to disengage his own node, before summoning Janeway and the Doctor.
Transported to Sickbay, Icheb threatens to refuse treatment unless the node is used to cure Seven. With each of them refusing to use it, Icheb argues with Seven and Janeway, eventually persuading them to follow his course of action.
After regenerating for six days, Seven's implants have adapted to the new cortical node, and although Icheb is still in sickbay, he is expected to recover. Seven stands over him, and agrees to help to coach him for the Academy entrance exam, before beginning to cry once more - this time, with her ocular implant working "perfectly".
When Seven reviews a list of all the Voyager crew members killed since the ship came to the Delta Quadrant, most of the names were main characters from the television series The West Wing. Denise Okuda, who may have been responsible for the graphic, is a West Wing fan and has merchandise from that series prominently displayed on her computer as seen in interviews on the Voyager DVDs.